Пример #1
0
        public static new WriteStructuredFieldOrder Factory(InputByteArray InputArray)
        {
            WriteStructuredFieldOrder fieldOrder = null;

            var buf = InputArray.PeekBytes(10);

            var wtdOrder    = buf[0].ToWtdOrder();
            var majorLength = buf.BigEndianBytesToShort(1);

            var fieldBytes = InputArray.PeekBytes(majorLength + 1);

            var classByte = buf[3];
            var typeByte  = buf[4];

            if (classByte == 0xd9)
            {
                if (typeByte == 0x51)
                {
                    fieldOrder = new CreateWindowStructuredField(InputArray);
                }
                else if (typeByte == 0x60)
                {
                    fieldOrder = new DrawGridLinesStructuredField(InputArray);
                }
                else
                {
                    throw new Exception("unexpected typeByte");
                }
            }
            return(fieldOrder);
        }
Пример #2
0
        public static WtdOrderBase Factory(InputByteArray InputArray)
        {
            WtdOrderBase orderBase = null;
            var          b1        = InputArray.PeekByte(0);
            var          wtdOrder  = b1.ToWtdOrder();

            if (wtdOrder == null)
            {
                return(null);
            }

            if (wtdOrder.Value == WtdOrder.StartHeader)
            {
                orderBase = new StartHeaderOrder(InputArray);
            }

            else if (wtdOrder.Value == WtdOrder.SetBufferAddress)
            {
                orderBase = new SetBufferAddressOrder(InputArray);
            }

            else if (wtdOrder.Value == WtdOrder.RepeatToAddress)
            {
                orderBase = new RepeatToAddressOrder(InputArray);
            }

            else if (wtdOrder.Value == WtdOrder.TransparentData)
            {
                orderBase = new TransparentDataOrder(InputArray);
            }

            else if (wtdOrder.Value == WtdOrder.StartField)
            {
                orderBase = new StartFieldOrder(InputArray);
            }

            else if (wtdOrder.Value == WtdOrder.InsertCursor)
            {
                orderBase = new InsertCursorOrder(InputArray);
            }
            else if (wtdOrder.Value == WtdOrder.WriteStructuredField)
            {
                orderBase = WriteStructuredFieldOrder.Factory(InputArray);
            }
            else if (wtdOrder.Value == WtdOrder.EraseToAddress)
            {
                orderBase = new EraseToAddressOrder(InputArray);
            }

            return(orderBase);
        }