示例#1
0
 private void DrawLine(Pen pen, LINE lin)
 {
     AddLabel(Algorithms.Functions.Helpers.Helper.HalfwayPoint(lin), lin.position.ToString());
     DrawLine(pen, lin.startPlace, lin.endPlace);
 }
示例#2
0
 public static Point HalfwayPoint(LINE lin)
 {
     return(HalfwayPoint(lin.startPlace, lin.endPlace));
 }
示例#3
0
 /// <summary>
 /// There are no comments for LINE in the schema.
 /// </summary>
 public void AddToLINE(LINE lINE)
 {
     base.AddObject("LINE", lINE);
 }
示例#4
0
        private void Print_Click(object sender, EventArgs e)
        {
            const string LINE = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

            int hLength       = tbHorizontalLength.Text.Cast <int>();
            int vLength       = tbVerticaLength.Text.Cast <int>();
            int spaces        = tbSpaces.Text.Cast <int>(); //2
            int tabs          = tbTabs.Text.Cast <int>();   //1
            int numberOflines = tbNumberOfLines.Text.Cast <int>();
            int barcodePos    = tbBarcodePos.Text.Cast <int>();

            StringBuilder b = new StringBuilder();

            if (cbPrintBarcode.Checked)
            {
                b.Append(MTPL.SetAbsoluteHorizontalPosition(barcodePos));
                b.Append(MTPL.PrintI2Of5Barcode("123456789", 10, "000"));
                b.AppendLine();
            }

            for (int i = 0; i < vLength; i++)
            {
                b.Append(LINE.CharOfString(i));

                if (i % numberOflines == 0)
                {
                    for (int j = 0; j < hLength; j++)
                    {
                        b.Append(LINE.CharOfString(i + j + 1));
                    }
                    b.AppendLine();
                }
                else if (i % numberOflines == 1)
                {
                    for (int j = 0; j < 5; j++)
                    {
                        b.Append(" ".Miltiply(j));
                        b.Append(LINE.CharOfString(i + j + 1));
                    }
                    b.AppendLine();
                }
                else if (i % numberOflines == 2)
                {
                    for (int j = 0; j < 5; j++)
                    {
                        b.Append("\t".Miltiply(j));
                        b.Append(LINE.CharOfString(i + j + 1));
                    }
                    b.AppendLine();
                }
                else
                {
                    b.AppendLine();
                }
            }

            string text = b.toString();

            string printerName = tbPrinterName.Text;

            PrinterQueue.AddJob(printerName, this.Text, text);
        }