/// <summary> /// build a byte array containing a start of field order. /// </summary> /// <param name="FFW1"></param> /// <param name="FFW2"></param> /// <param name="AttrByte"></param> /// <param name="Length"></param> /// <returns></returns> public static byte[] Build(byte FFW1, byte FFW2, byte AttrByte, int Length) { var sof = new StartFieldOrder(FFW1, FFW2, AttrByte, Length); var buf = sof.ToBytes(); return(buf); }
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); }