ReadMetaProperty() public method

Read a MetaProperties value from stream, and advance the position within the stream by 4, compare it to the desired MetaProperties
public ReadMetaProperty ( MetaProperties meta ) : bool
meta MetaProperties The desired Markers
return bool
Ejemplo n.º 1
0
        /// <summary>
        ///  Deserialize fields from a FastTransferStream.
        /// </summary>
        /// <param name="stream">A FastTransferStream.</param>
        public override void Deserialize(FastTransferStream stream)
        {
            // Actual stream deserialization:
            // folderContent        =  propList [PidTagEcWarning]
            //        ( (*(*PidTagFXDelProp PidTagNewFXFolder)) / folderMessages ) 
            //       [ *PidTagFXDelProp *SubFolder ]
            this.warningCode = null;
            this.fxdelPropList = new List<uint>();
            this.newFXFolderList = new List<Tuple<List<uint>, MS_OXCFXICS.FolderReplicaInfo>>();
            this.propList = new PropList(stream);
            if (!stream.IsEndOfStream)
            {
                uint marker = stream.VerifyUInt32();
                if (marker == (uint)MetaProperties.PidTagEcWarning)
                {
                    marker = stream.ReadUInt32();
                    this.warningCode = stream.ReadUInt32();
                    marker = stream.VerifyUInt32();
                }

                long lastPosi = stream.Position;
                while (stream.VerifyMetaProperty(MetaProperties.PidTagFXDelProp)
                    || stream.VerifyMetaProperty(MetaProperties.PidTagNewFXFolder))
                {
                    lastPosi = stream.Position;
                    List<uint> tempFXdel = new List<uint>();
                    while (stream.VerifyMetaProperty(MetaProperties.PidTagFXDelProp))
                    {
                        stream.ReadMetaProperty(MetaProperties.PidTagFXDelProp);
                        uint prop = stream.ReadUInt32();
                        tempFXdel.Add(prop);
                    }

                    if (!stream.IsEndOfStream)
                    {
                        marker = stream.VerifyUInt32();
                    }

                    if (marker == (uint)MetaProperties.PidTagNewFXFolder)
                    {
                        marker = stream.ReadUInt32();
                        stream.ReadUInt32();
                        FolderReplicaInfo fri = new FolderReplicaInfo(stream);
                        this.newFXFolderList.Add(
                            new Tuple<List<uint>, FolderReplicaInfo>(
                                tempFXdel, fri));
                    }
                    else
                    {
                        stream.Position = lastPosi;
                        marker = stream.VerifyUInt32();
                        break;
                    }
                }

                if (FolderMessages.Verify(stream))
                {
                    this.folderMessages = new FolderMessages(stream);
                }

                this.subFolders = new List<SubFolder>();
                while (stream.VerifyMetaProperty(MetaProperties.PidTagFXDelProp))
                {
                    stream.ReadMetaProperty(MetaProperties.PidTagFXDelProp);
                    uint prop = stream.ReadUInt32();
                    this.fxdelPropList.Add(prop);
                }

                while (SubFolder.Verify(stream))
                {
                    this.subFolders.Add(new SubFolder(stream));
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///  Deserialize fields from a FastTransferStream.
        /// </summary>
        /// <param name="stream">A FastTransferStream.</param>
        public override void Deserialize(FastTransferStream stream)
        {
            // Actual stream deserialization:
            // folderContent        =  propList [PidTagEcWarning]
            //        ( (*(*PidTagFXDelProp PidTagNewFXFolder)) / folderMessages )
            //       [ *PidTagFXDelProp *SubFolder ]
            this.warningCode     = null;
            this.fxdelPropList   = new List <uint>();
            this.newFXFolderList = new List <Tuple <List <uint>, MS_OXCFXICS.FolderReplicaInfo> >();
            this.propList        = new PropList(stream);
            if (!stream.IsEndOfStream)
            {
                uint marker = stream.VerifyUInt32();
                if (marker == (uint)MetaProperties.PidTagEcWarning)
                {
                    marker           = stream.ReadUInt32();
                    this.warningCode = stream.ReadUInt32();
                    marker           = stream.VerifyUInt32();
                }

                long lastPosi = stream.Position;
                while (stream.VerifyMetaProperty(MetaProperties.PidTagFXDelProp) ||
                       stream.VerifyMetaProperty(MetaProperties.PidTagNewFXFolder))
                {
                    lastPosi = stream.Position;
                    List <uint> tempFXdel = new List <uint>();
                    while (stream.VerifyMetaProperty(MetaProperties.PidTagFXDelProp))
                    {
                        stream.ReadMetaProperty(MetaProperties.PidTagFXDelProp);
                        uint prop = stream.ReadUInt32();
                        tempFXdel.Add(prop);
                    }

                    if (!stream.IsEndOfStream)
                    {
                        marker = stream.VerifyUInt32();
                    }

                    if (marker == (uint)MetaProperties.PidTagNewFXFolder)
                    {
                        marker = stream.ReadUInt32();
                        stream.ReadUInt32();
                        FolderReplicaInfo fri = new FolderReplicaInfo(stream);
                        this.newFXFolderList.Add(
                            new Tuple <List <uint>, FolderReplicaInfo>(
                                tempFXdel, fri));
                    }
                    else
                    {
                        stream.Position = lastPosi;
                        marker          = stream.VerifyUInt32();
                        break;
                    }
                }

                if (FolderMessages.Verify(stream))
                {
                    this.folderMessages = new FolderMessages(stream);
                }

                this.subFolders = new List <SubFolder>();
                while (stream.VerifyMetaProperty(MetaProperties.PidTagFXDelProp))
                {
                    stream.ReadMetaProperty(MetaProperties.PidTagFXDelProp);
                    uint prop = stream.ReadUInt32();
                    this.fxdelPropList.Add(prop);
                }

                while (SubFolder.Verify(stream))
                {
                    this.subFolders.Add(new SubFolder(stream));
                }
            }
        }