2.2.1.9 Serial Number
상속: BaseStructure
 /// <summary>
 /// Parse the StorageManifestDataElement structure.
 /// </summary>
 /// <param name="s">An stream containing StorageManifestDataElement structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.DataElementStart = new bit16StreamObjectHeaderStart();
     this.DataElementStart.Parse(s);
     this.DataElementExtendedGUID = new ExtendedGUID();
     this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
     this.SerialNumber = new SerialNumber();
     this.SerialNumber = this.SerialNumber.TryParse(s);
     this.DataElementType = new CompactUnsigned64bitInteger();
     this.DataElementType = this.DataElementType.TryParse(s);
     this.StorageManifestSchemaGUID = new bit16StreamObjectHeaderStart();
     this.StorageManifestSchemaGUID.Parse(s);
     this.GUID = ReadGuid();
     List<StorageManifestRootDeclareValues> StorageManifestRootDeclareList = new List<StorageManifestRootDeclareValues>();
     while ((CurrentByte() & 0x03) == 0x0 && ((CurrentByte() >> 3) & 0x3F) == 0x07)
     {
         StorageManifestRootDeclareValues tempStorageManifestRootDeclare = new StorageManifestRootDeclareValues();
         tempStorageManifestRootDeclare.Parse(s);
         StorageManifestRootDeclareList.Add(tempStorageManifestRootDeclare);
     }
     this.StorageManifestRootDeclare = StorageManifestRootDeclareList.ToArray();
     this.DataElementEnd = new bit8StreamObjectHeaderEnd();
     this.DataElementEnd.Parse(s);
 }
        /// <summary>
        /// Parse the StorageIndexDataElement structure.
        /// </summary>
        /// <param name="s">An stream containing StorageIndexDataElement structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.DataElementStart = new bit16StreamObjectHeaderStart();
            this.DataElementStart.Parse(s);
            this.DataElementExtendedGUID = new ExtendedGUID();
            this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
            this.SerialNumber = new SerialNumber();
            this.SerialNumber = this.SerialNumber.TryParse(s);
            this.DataElementType = new CompactUnsigned64bitInteger();
            this.DataElementType = this.DataElementType.TryParse(s);

            int StorageIndexType = (CurrentByte() >> 3) & 0x3F;
            List<object> DataList = new List<object>();
            while ((CurrentByte() & 0x03) == 0x0 && (StorageIndexType == 0x11 || StorageIndexType == 0x0E || StorageIndexType == 0x0D))
            {
                switch (StorageIndexType)
                {
                    case 0x11:
                        StorageIndexManifestMappingValues ManifestMappingValue = new StorageIndexManifestMappingValues();
                        ManifestMappingValue.Parse(s);
                        DataList.Add(ManifestMappingValue);
                        break;
                    case 0x0E:
                        StorageIndexCellMappingValues CellMappingValue = new StorageIndexCellMappingValues();
                        CellMappingValue.Parse(s);
                        DataList.Add(CellMappingValue);
                        break;
                    case 0x0D:
                        StorageIndexRevisionMappingValues RevisionMappingValue = new StorageIndexRevisionMappingValues();
                        RevisionMappingValue.Parse(s);
                        DataList.Add(RevisionMappingValue);
                        break;
                    default:
                        throw new Exception("The StorageIndexType is not right.");
                }
                StorageIndexType = (CurrentByte() >> 3) & 0x3F;
            }
            this.StorageIndexDataElementData = DataList.ToArray();
            this.DataElementEnd = new bit8StreamObjectHeaderEnd();
            this.DataElementEnd.Parse(s);
        }
 /// <summary>
 /// Parse the StorageIndexRevisionMappingValues structure.
 /// </summary>
 /// <param name="s">An stream containing StorageIndexRevisionMappingValues structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.StorageIndexRevisionMapping = new bit16StreamObjectHeaderStart();
     this.StorageIndexRevisionMapping.Parse(s);
     this.RevisionExtendedGUID = new ExtendedGUID();
     this.RevisionExtendedGUID = this.RevisionExtendedGUID.TryParse(s);
     this.RevisionMappingExtendedGUID = new ExtendedGUID();
     this.RevisionMappingExtendedGUID = this.RevisionMappingExtendedGUID.TryParse(s);
     this.RevisionMappingSerialNumber = new SerialNumber();
     this.RevisionMappingSerialNumber = this.RevisionMappingSerialNumber.TryParse(s);
 }
        /// <summary>
        /// Parse the RevisionManifestDataElement structure.
        /// </summary>
        /// <param name="s">An stream containing RevisionManifestDataElement structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.DataElementStart = new bit16StreamObjectHeaderStart();
            this.DataElementStart.Parse(s);
            this.DataElementExtendedGUID = new ExtendedGUID();
            this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
            this.SerialNumber = new SerialNumber();
            this.SerialNumber = this.SerialNumber.TryParse(s);
            this.DataElementType = new CompactUnsigned64bitInteger();
            this.DataElementType = this.DataElementType.TryParse(s);
            this.RevisionManifest = new bit16StreamObjectHeaderStart();
            this.RevisionManifest.Parse(s);
            this.RevisionID = new ExtendedGUID();
            this.RevisionID = this.RevisionID.TryParse(s);
            this.BaseRevisionID = new ExtendedGUID();
            this.BaseRevisionID = this.BaseRevisionID.TryParse(s);

            int RevisionType = (CurrentByte() >> 3) & 0x3F;
            List<object> DataList = new List<object>();
            while ((CurrentByte() & 0x03) == 0x0 && (RevisionType == 0x0A || RevisionType == 0x19))
            {
                switch (RevisionType)
                {
                    case 0x0A:
                        {
                            RevisionManifestRootDeclareValues RootDeclareValue = new RevisionManifestRootDeclareValues();
                            RootDeclareValue.Parse(s);
                            DataList.Add(RootDeclareValue);
                            break;
                        }
                    case 0x19:
                        {
                            RevisionManifestObjectGroupReferencesValues ObjectGroupReferencesValue = new RevisionManifestObjectGroupReferencesValues();
                            ObjectGroupReferencesValue.Parse(s);
                            DataList.Add(ObjectGroupReferencesValue);
                            break;
                        }
                    default:
                        throw new Exception("The RevisionType is not right.");
                }
                RevisionType = (CurrentByte() >> 3) & 0x3F;
            }

            this.RevisionManifestDataElementsData = DataList.ToArray();
            this.DataElementEnd = new bit8StreamObjectHeaderEnd();
            this.DataElementEnd.Parse(s);
        }
 /// <summary>
 /// Parse the SerialNumber structure.
 /// </summary>
 /// <param name="s">An stream containing SerialNumber structure.</param>
 public SerialNumber TryParse(Stream s)
 {
     base.Parse(s);
     byte temp = ReadByte();
     s.Position -= 1;
     SerialNumber serialNumber = new SerialNumber();
     if (temp == 0x0)
     {
         serialNumber = new SerialNumberNullValue();
         serialNumber.Parse(s);
     }
     else if (temp == 0x80)
     {
         serialNumber = new SerialNumber64BitUintValue();
         serialNumber.Parse(s);
     }
     return serialNumber;
 }
        /// <summary>
        /// Parse the ObjectGroupDataElements structure.
        /// </summary>
        /// <param name="s">An stream containing ObjectGroupDataElements structure.</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.DataElementStart = new bit16StreamObjectHeaderStart();
            this.DataElementStart.Parse(s);
            this.DataElementExtendedGUID = new ExtendedGUID();
            this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
            this.SerialNumber = new SerialNumber();
            this.SerialNumber = this.SerialNumber.TryParse(s);
            this.DataElementType = new CompactUnsigned64bitInteger();
            this.DataElementType = this.DataElementType.TryParse(s);

            if (ContainsStreamObjectHeader(0x06))
            {
                this.DataElementHash = new DataElementHash();
                this.DataElementHash.Parse(s);
            }
            this.ObjectGroupDeclarationsStart = new StreamObjectHeader();
            this.ObjectGroupDeclarationsStart = this.ObjectGroupDeclarationsStart.TryParse(s);

            List<object> DeclarationList = new List<object>();
            while (ContainsStreamObjectHeader(0x18) || ContainsStreamObjectHeader(0x05))
            {
                if (ContainsStreamObjectHeader(0x18))
                {
                    ObjectDeclaration Declaration = new ObjectDeclaration();
                    Declaration.Parse(s);
                    DeclarationList.Add(Declaration);
                }
                else if (ContainsStreamObjectHeader(0x05))
                {
                    ObjectDataBLOBDeclaration DeclarationBLOB = new ObjectDataBLOBDeclaration();
                    DeclarationBLOB.Parse(s);
                    DeclarationList.Add(DeclarationBLOB);
                }
            }
            this.ObjectDeclarationOrObjectDataBLOBDeclaration = DeclarationList.ToArray();
            this.ObjectGroupDeclarationsEnd = new bit8StreamObjectHeaderEnd();
            this.ObjectGroupDeclarationsEnd.Parse(s);

            if (ContainsStreamObjectHeader(0x79))
            {
                this.ObjectMetadataDeclaration = new ObjectMetadataDeclaration();
                this.ObjectMetadataDeclaration.Parse(s);
            }

            this.ObjectGroupDataStart = new StreamObjectHeader();
            this.ObjectGroupDataStart = this.ObjectGroupDataStart.TryParse(s);

            List<object> ObjectDataList = new List<object>();
            while (ContainsStreamObjectHeader(0x16) || ContainsStreamObjectHeader(0x1C))
            {
                if (ContainsStreamObjectHeader(0x16))
                {
                    ObjectData data = new ObjectData();
                    data.Parse(s);
                    ObjectDataList.Add(data);
                }
                else if (ContainsStreamObjectHeader(0x1C))
                {
                    ObjectDataBLOBReference DataBLOB = new ObjectDataBLOBReference();
                    DataBLOB.Parse(s);
                    ObjectDataList.Add(DataBLOB);
                }
            }
            this.ObjectDataOrObjectDataBLOBReference = ObjectDataList.ToArray();

            this.ObjectGroupDataEnd = new bit8StreamObjectHeaderEnd();
            this.ObjectGroupDataEnd.Parse(s);
            this.DataElementEnd = new bit8StreamObjectHeaderEnd();
            this.DataElementEnd.Parse(s);
        }
 /// <summary>
 /// Parse the ObjectDataBLOBDataElements structure.
 /// </summary>
 /// <param name="s">An stream containing ObjectDataBLOBDataElements structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.DataElementStart = new bit16StreamObjectHeaderStart();
     this.DataElementStart.Parse(s);
     this.DataElementExtendedGUID = new ExtendedGUID();
     this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
     this.SerialNumber = new SerialNumber();
     this.SerialNumber = this.SerialNumber.TryParse(s);
     this.DataElementType = new CompactUnsigned64bitInteger();
     this.DataElementType = this.DataElementType.TryParse(s);
     this.ObjectDataBLOB = new StreamObjectHeader();
     this.ObjectDataBLOB = this.ObjectDataBLOB.TryParse(s);
     this.Data = new BinaryItem();
     this.Data.Parse(s);
     this.DataElementEnd = new bit8StreamObjectHeaderEnd();
     this.DataElementEnd.Parse(s);
 }
 /// <summary>
 /// Parse the DataElementFragmentDataElement structure.
 /// </summary>
 /// <param name="s">An stream containing DataElementFragmentDataElement structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.DataElementStart = new bit16StreamObjectHeaderStart();
     this.DataElementStart.Parse(s);
     this.DataElementExtendedGUID = new ExtendedGUID();
     this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
     this.SerialNumber = new SerialNumber();
     this.SerialNumber = this.SerialNumber.TryParse(s);
     this.DataElementType = new CompactUnsigned64bitInteger();
     this.DataElementType = this.DataElementType.TryParse(s);
     this.DataElementFragment = new bit32StreamObjectHeaderStart();
     this.DataElementFragment.Parse(s);
     this.FragmentExtendedGUID = new ExtendedGUID();
     this.FragmentExtendedGUID = this.FragmentExtendedGUID.TryParse(s);
     this.FragmentDataElementSize = new CompactUnsigned64bitInteger();
     this.FragmentDataElementSize = this.FragmentDataElementSize.TryParse(s);
     this.FragmentFileChunkReference = new FileChunkReference();
     this.FragmentFileChunkReference.Parse(s);
     this.FragmentData = new BinaryItem();
     this.FragmentData.Parse(s);
     this.DataElementEnd = new bit8StreamObjectHeaderEnd();
     this.DataElementEnd.Parse(s);
 }
 /// <summary>
 /// Parse the CellManifestDataElement structure.
 /// </summary>
 /// <param name="s">An stream containing CellManifestDataElement structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.DataElementStart = new bit16StreamObjectHeaderStart();
     this.DataElementStart.Parse(s);
     this.DataElementExtendedGUID = new ExtendedGUID();
     this.DataElementExtendedGUID = this.DataElementExtendedGUID.TryParse(s);
     this.SerialNumber = new SerialNumber();
     this.SerialNumber = this.SerialNumber.TryParse(s);
     this.DataElementType = new CompactUnsigned64bitInteger();
     this.DataElementType = this.DataElementType.TryParse(s);
     this.CellManifestCurrentRevision = new bit16StreamObjectHeaderStart();
     this.CellManifestCurrentRevision.Parse(s);
     this.CellManifestCurrentRevisionExtendedGUID = new ExtendedGUID();
     this.CellManifestCurrentRevisionExtendedGUID = this.CellManifestCurrentRevisionExtendedGUID.TryParse(s);
     this.DataElementEnd = new bit8StreamObjectHeaderEnd();
     this.DataElementEnd.Parse(s);
 }
 /// <summary>
 /// Parse the CellKnowledgeEntry structure.
 /// </summary>
 /// <param name="s">An stream containing CellKnowledgeEntry structure.</param>
 public override void Parse(Stream s)
 {
     base.Parse(s);
     this.cellKnowledgeEntry = new bit16StreamObjectHeaderStart();
     this.cellKnowledgeEntry.Parse(s);
     this.SerialNumber = new SerialNumber();
     this.SerialNumber = this.SerialNumber.TryParse(s);
 }