LEADTOOLS Barcode (Leadtools.Barcode assembly)
LEAD Technologies, Inc

GetAllDefaultOptions Method (BarcodeWriter)

Example 







Gets a list of all the current barcode write options. .NET support Silverlight support
Syntax
public BarcodeWriteOptions[] GetAllDefaultOptions()
'Declaration
 
Public Function GetAllDefaultOptions() As BarcodeWriteOptions()
'Usage
 
Dim instance As BarcodeWriter
Dim value() As BarcodeWriteOptions
 
value = instance.GetAllDefaultOptions()
public BarcodeWriteOptions[] GetAllDefaultOptions()
ObjectiveC Syntax
 function Leadtools.Barcode.BarcodeWriter.GetAllDefaultOptions()
public:
array<BarcodeWriteOptions^>^ GetAllDefaultOptions(); 

Return Value

An array of BarcodeWriteOptions derived types that contain all the default write options currently set in this BarcodeWriter.
Remarks

The BarcodeWriter object contains an array of all the default write options used by the WriteBarcode method when no explicit options are passed by the user.

Refer to the BarcodeWriteOptions class for a list of the symbologies and the type of the derived BarcodeWriteOptions used by LEADTOOLS.

To get the options for a specific symbology, refer to GetDefaultOptions

Example
Copy CodeCopy Code  
Public Sub BarcodeWriter_GetAllDefaultOptionsExample()
   Dim engine As New BarcodeEngine()
   Dim writer As BarcodeWriter = engine.Writer

   ' Show information on all the default write option classes
   Dim writeOptionsArray() As BarcodeWriteOptions = writer.GetAllDefaultOptions()
   Console.WriteLine("Write options:")
   For Each writeOptions As BarcodeWriteOptions In writeOptionsArray
      Console.WriteLine("  {0} ({1}) supports options for the following symbologies:", writeOptions.GetType().Name, writeOptions.FriendlyName)
      Console.WriteLine("     ")
      Dim symbologies() As BarcodeSymbology = writeOptions.GetSupportedSymbologies()
      For i As Integer = 0 To symbologies.Length - 1
         Console.Write(symbologies(i))
         If i <> (symbologies.Length - 1) Then
            Console.Write(", ")
         Else
            Console.WriteLine()
         End If
      Next
   Next
End Sub
public void BarcodeWriter_GetAllDefaultOptionsExample()
{
   BarcodeEngine engine = new BarcodeEngine();
   BarcodeWriter writer = engine.Writer;

   // Show information on all the default write option classes
   BarcodeWriteOptions[] writeOptionsArray = writer.GetAllDefaultOptions();
   Console.WriteLine("Write options:");
   foreach(BarcodeWriteOptions writeOptions in writeOptionsArray)
   {
      Console.WriteLine("  {0} ({1}) supports options for the following symbologies:", writeOptions.GetType().Name, writeOptions.FriendlyName);
      Console.WriteLine("     ");
      BarcodeSymbology[] symbologies = writeOptions.GetSupportedSymbologies();
      for(int i = 0; i < symbologies.Length; i++)
      {
         Console.Write(symbologies[i]);
         if(i != (symbologies.Length - 1))
         {
            Console.Write(", ");
         }
         else
         {
            Console.WriteLine();
         }
      }
   }
}
[TestMethod]
public void BarcodeWriter_GetAllDefaultOptionsExample()
{
   BarcodeEngine engine = new BarcodeEngine();
   BarcodeWriter writer = engine.Writer;
   // Show information on all the default write option classes
   IBarcodeWriteOptions[] writeOptionsArray = writer.GetAllDefaultOptions();
   Debug.WriteLine("Write options:");
   foreach(IBarcodeWriteOptions writeOptions in writeOptionsArray)
   {
      Debug.WriteLine("  {0} ({1}) supports options for the following symbologies:", writeOptions.GetType().Name, writeOptions.FriendlyName);
      Debug.WriteLine("     ");
      BarcodeSymbology[] symbologies = writeOptions.GetSupportedSymbologies();
      StringBuilder sb = new StringBuilder();
      for(int i = 0; i < symbologies.Length; i++)
      {
         sb.Append(symbologies[i].ToString());
         if(i != (symbologies.Length - 1))
         {
            sb.Append(", ");
         }
         else
         {
            sb.AppendLine();
         }
      }
      Debug.WriteLine(sb.ToString());
   }
}
public void BarcodeWriter_GetAllDefaultOptionsExample()
{
   BarcodeEngine engine = new BarcodeEngine();
   BarcodeWriter writer = engine.Writer;
   // Show information on all the default write option classes
   BarcodeWriteOptions[] writeOptionsArray = writer.GetAllDefaultOptions();
   Console.WriteLine("Write options:");
   foreach(BarcodeWriteOptions writeOptions in writeOptionsArray)
   {
      Console.WriteLine("  {0} ({1}) supports options for the following symbologies:", writeOptions.GetType().Name, writeOptions.FriendlyName);
      Console.WriteLine("     ");
      BarcodeSymbology[] symbologies = writeOptions.GetSupportedSymbologies();
      for(int i = 0; i < symbologies.Length; i++)
      {
         Console.Write(symbologies[i]);
         if(i != (symbologies.Length - 1))
         {
            Console.Write(", ");
         }
         else
         {
            Console.WriteLine();
         }
      }
   }
}
Public Sub BarcodeWriter_GetAllDefaultOptionsExample()
  Dim engine As BarcodeEngine = New BarcodeEngine()
  Dim writer As BarcodeWriter = engine.Writer
  ' Show information on all the default write option classes
  Dim writeOptionsArray As BarcodeWriteOptions() = writer.GetAllDefaultOptions()
  Console.WriteLine("Write options:")
  For Each writeOptions As BarcodeWriteOptions In writeOptionsArray
    Console.WriteLine("  {0} ({1}) supports options for the following symbologies:", writeOptions.GetType().Name, writeOptions.FriendlyName)
    Console.WriteLine("     ")
    Dim symbologies As BarcodeSymbology() = writeOptions.GetSupportedSymbologies()
    Dim i As Integer = 0
    Do While i < symbologies.Length
       Console.Write(symbologies(i))
       If i <> (symbologies.Length - 1) Then
         Console.Write(", ")
       Else
         Console.WriteLine()
       End If
       i += 1
    Loop
  Next writeOptions
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

BarcodeWriter Class
BarcodeWriter Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Barcode requires a Barcode Module license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features