private bool TryParse(byte[] buffer, ref int pos) { IMarker marker; if (Marker.TryCreateMarker(buffer, ref pos, out marker) && Marker.IsSpecificMarker(marker, Marker.NewAttach)) { NewAttachMarker = marker; } else return false; IPropValue attachCount = StreamUtil.ParsePropValue(buffer, ref pos); AttachNumber = attachCount as FixPropType_PropInfo_FixedSizeValue; if (AttachNumber == null) throw new ArgumentException("Attach number parse error."); if (AttachNumber.PropIdWithType != 0x0E210003) throw new ArgumentException("Attach number parse error."); AttachmentContent.TryParse(buffer, ref pos, out AttachContent); if (Marker.TryCreateMarker(buffer, ref pos, out marker) && Marker.IsSpecificMarker(marker, Marker.EndAttach)) { EndAttachMarker = marker; } else throw new ArgumentException("Attach end parse error."); return true; }
internal static IPropValue ParseFixPropType_PropInfo_FixedSizeValue(IPropType fixPropType, byte[] buffer, ref int pos) { FixPropType_PropInfo_FixedSizeValue fixedPropValue = new FixPropType_PropInfo_FixedSizeValue(fixPropType as IFixedPropType); fixedPropValue.ParsePropValue(buffer, ref pos); return fixedPropValue; }