Example #1
0
        public void SingleElement()
        {
            var textField = new ZplTextField(null, 50, 100, ZplConstants.Font.Default);
            var output    = new ZplFieldNumber(100, textField).ToZplString();

            Assert.IsNotNull(output);
            Assert.AreEqual("^A0N,30,30\n^FO50,100\n^FH\n^FN100^FS", output);
        }
Example #2
0
        public override ZplElementBase Analyze(string zplCommand)
        {
            // If next field number has been set and was not consumed by a field data
            // it has to be stored as a command so that it is handled when merging formats
            ZplElementBase element     = null;
            int?           fieldNumber = this.VirtualPrinter.NextFieldNumber;

            if (fieldNumber.HasValue)
            {
                this.VirtualPrinter.ClearNextFieldNumber();
                ZplElementBase dataElement = _fieldDataAnalyzer.Analyze(zplCommand);
                element = new ZplFieldNumber(fieldNumber.Value, dataElement);
            }

            this.VirtualPrinter.ClearNextElementPosition();
            this.VirtualPrinter.ClearNextElementFieldBlock();
            this.VirtualPrinter.ClearNextElementFieldData();
            this.VirtualPrinter.ClearNextElementFieldReverse();
            this.VirtualPrinter.ClearNextFont();
            this.VirtualPrinter.ClearComments();

            return(element);
        }