//TODO: make use of Locked /* protected bool locked = false; public bool Locked { get { return locked; } } */ public void SetHeaderData (byte[] data) { EndianFlag endianness = (EndianFlag)data[0]; MessageReader reader = new MessageReader (endianness, data); Header = (Header)reader.ReadStruct (typeof (Header)); }
public void ParseHeader () { //GetValue (stream, typeof (Header), out Header); EndianFlag endianness = (EndianFlag)HeaderData[0]; MessageReader reader = new MessageReader (endianness, HeaderData); object valT; reader.GetValueStruct (typeof (Header), out valT); Header = (Header)valT; /* //foreach (HeaderField field in HeaderFields) foreach (KeyValuePair<FieldCode,object> field in Header.Fields) { //Console.WriteLine (field.Key + " = " + field.Value); switch (field.Key) { case FieldCode.Invalid: break; case FieldCode.Path: Path = (ObjectPath)field.Value; break; case FieldCode.Interface: Interface = (string)field.Value; break; case FieldCode.Member: Member = (string)field.Value; break; case FieldCode.ErrorName: ErrorName = (string)field.Value; break; case FieldCode.ReplySerial: ReplySerial = (uint)field.Value; break; case FieldCode.Destination: Destination = (string)field.Value; break; case FieldCode.Sender: Sender = (string)field.Value; break; case FieldCode.Signature: Signature = (Signature)field.Value; break; } } */ }
//TODO: make use of Locked /* protected bool locked = false; public bool Locked { get { return locked; } } */ public void HandleHeader(Header headerIn) { Header = headerIn; }