static string CreateEncoding(DataMatrixEncoding dmEncoding, int length)
        {
            string tempencoding = "";

            switch (dmEncoding)
            {
            case DataMatrixEncoding.Ascii:
                tempencoding = new string('a', length);
                break;

            case DataMatrixEncoding.C40:
                tempencoding = new string('c', length);
                break;

            case DataMatrixEncoding.Text:
                tempencoding = new string('t', length);
                break;

            case DataMatrixEncoding.X12:
                tempencoding = new string('x', length);
                break;

            case DataMatrixEncoding.EDIFACT:
                tempencoding = new string('e', length);
                break;

            case DataMatrixEncoding.Base256:
                tempencoding = new string('b', length);
                break;
            }
            return(tempencoding);
        }
 /// <summary>
 /// Initializes a new instance of CodeDataMatrix.
 /// </summary>
 public CodeDataMatrix(string code, DataMatrixEncoding dmEncoding, int rows, int columns, XSize size)
     : this(code, CreateEncoding(dmEncoding, code.Length), rows, columns, 0, size)
 {
 }
 /// <summary>
 /// Initializes a new instance of CodeDataMatrix.
 /// </summary>
 public CodeDataMatrix(string code, DataMatrixEncoding dmEncoding, int length, XSize size)
     : this(code, CreateEncoding(dmEncoding, code.Length), length, length, 0, size)
 {
 }
 /// <summary>
 /// Sets the encoding of the DataMatrix.
 /// </summary>
 public void SetEncoding(DataMatrixEncoding dmEncoding)
 {
     Encoding = CreateEncoding(dmEncoding, Text.Length);
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of CodeDataMatrix.
 /// </summary>
 public CodeDataMatrix(string code, DataMatrixEncoding dmEncoding, int rows, int columns, XSize size)
     : this(code, CreateEncoding(dmEncoding, code.Length), rows, columns, 0, size)
 {}
示例#6
0
 /// <summary>
 /// Initializes a new instance of CodeDataMatrix.
 /// </summary>
 public CodeDataMatrix(string code, DataMatrixEncoding dmEncoding, int length, XSize size)
     : this(code, CreateEncoding(dmEncoding, code.Length), length, length, 0, size)
 {}
示例#7
0
 static string CreateEncoding(DataMatrixEncoding dmEncoding, int length)
 {
     string tempencoding = "";
     switch (dmEncoding)
     {
         case DataMatrixEncoding.Ascii:
             tempencoding = new string('a', length);
             break;
         case DataMatrixEncoding.C40:
             tempencoding = new string('c', length);
             break;
         case DataMatrixEncoding.Text:
             tempencoding = new string('t', length);
             break;
         case DataMatrixEncoding.X12:
             tempencoding = new string('x', length);
             break;
         case DataMatrixEncoding.EDIFACT:
             tempencoding = new string('e', length);
             break;
         case DataMatrixEncoding.Base256:
             tempencoding = new string('b', length);
             break;
     }
     return tempencoding;
 }
示例#8
0
 /// <summary>
 /// Sets the encoding of the DataMatrix.
 /// </summary>
 public void SetEncoding(DataMatrixEncoding dmEncoding)
 {
     Encoding = CreateEncoding(dmEncoding, Text.Length);
 }