예제 #1
0
        private void ProcessNextElement(byte[] buffer,ref int pos)
        {
            while (pos < buffer.Length)
            {
                UInt32 propertyIdWithType = (UInt32)ParseSerialize.ParseInt32(buffer, pos);
                // get fxDelProp
                if (propertyIdWithType == MetaProperty.MetaTagFXDelProp && FxDelPropWithRecv == null)
                {
                    IPropValue metaValue = StreamUtil.ParsePropValue(buffer, ref pos);
                    MetaProperty fxDelPropWithRecv = null;
                    MetaProperty.JudgePropIsMetaProp(metaValue, out fxDelPropWithRecv);
                    FxDelPropWithRecv = fxDelPropWithRecv;
                }

                // get recipients
                else if (propertyIdWithType == Marker.StartRecip)
                {
                    if (Recipients == null)
                        Recipients = new List<Recipient>();
                    Recipient recv = null;
                    if (Recipient.TryCreateRecipient(buffer, ref pos, out recv))
                    {
                        Recipients.Add(recv);
                    }
                }
                // get fxDelProp
                else if (propertyIdWithType == MetaProperty.MetaTagFXDelProp && FxDelPropWithAttach == null)
                {
                    IPropValue metaValue = StreamUtil.ParsePropValue(buffer, ref pos);
                    MetaProperty fxDelPropWithRecv = null;
                    MetaProperty.JudgePropIsMetaProp(metaValue, out fxDelPropWithRecv);
                    FxDelPropWithAttach = fxDelPropWithRecv;
                }
                // get Attachment
                else if (propertyIdWithType == Marker.NewAttach)
                {
                    if (Attachments == null)
                    {
                        Attachments = new List<Attachment>();
                    }

                    Attachment att = null;
                    if (Attachment.TryCreateAttachment(buffer, ref pos, out att))
                    {
                        Attachments.Add(att);
                    }
                }
                else
                {
                    IsEnd = true;
                    break;
                }
            }
        }
예제 #2
0
 public static void JudgePropIsMetaProp(IPropValue propValue, out MetaProperty metaProperty)
 {
     if (JudgePropIsMetaProp(propValue.PropIdWithType))
     {
         metaProperty = new MetaProperty(propValue);
         return;
     }
     throw new ArgumentException("Property is not Metaproperty.");
 }