示例#1
0
        private static void SendToPrinter(LinePrinter printer, ILineFormatter line)
        {
            var data = line.GetFormattedLine();

            if (!data.StartsWith("<"))
                printer.WriteLine(data, line.FontHeight, line.FontWidth, LineAlignment.Left);
            else if (line.Tag.TagName == "eb")
                printer.EnableBold();
            else if (line.Tag.TagName == ("db"))
                printer.DisableBold();
            else if (line.Tag.TagName == "bmp")
                printer.PrintBitmap(RemoveTag(data));
            else if (line.Tag.TagName == "cut")
                printer.Cut();
            else if (line.Tag.TagName == "beep")
                printer.Beep();
            else if (line.Tag.TagName == "drawer")
                printer.OpenCashDrawer();
            else if (line.Tag.TagName == "b")
                printer.Beep((char)line.FontHeight, (char)line.FontWidth);
            else if (line.Tag.TagName == ("xct"))
                printer.ExecCommand(RemoveTag(data));
        }