object data BLOB reference
Inheritance: StreamObject
コード例 #1
0
        public static RevisionStoreObjectGroup CreateInstance(ExGuid objectGroupId, ObjectGroupDataElementData dataObject, bool isEncryption)
        {
            RevisionStoreObjectGroup objectGroup = new RevisionStoreObjectGroup(objectGroupId);
            Dictionary <ExGuid, RevisionStoreObject> objectDict = new Dictionary <ExGuid, RevisionStoreObject>();

            if (isEncryption == false)
            {
                RevisionStoreObject revisionObject = null;
                for (int i = 0; i < dataObject.ObjectGroupDeclarations.ObjectDeclarationList.Count; i++)
                {
                    ObjectGroupObjectDeclare objectDeclaration = dataObject.ObjectGroupDeclarations.ObjectDeclarationList[i];
                    ObjectGroupObjectData    objectData        = dataObject.ObjectGroupData.ObjectGroupObjectDataList[i];

                    if (!objectDict.ContainsKey(objectDeclaration.ObjectExtendedGUID))
                    {
                        revisionObject = new RevisionStoreObject();
                        revisionObject.ObjectGroupID = objectGroupId;
                        revisionObject.ObjectID      = objectDeclaration.ObjectExtendedGUID;
                        objectDict.Add(objectDeclaration.ObjectExtendedGUID, revisionObject);
                    }
                    else
                    {
                        revisionObject = objectDict[objectDeclaration.ObjectExtendedGUID];
                    }
                    if (objectDeclaration.ObjectPartitionID.DecodedValue == 4)
                    {
                        revisionObject.JCID = new JCIDObject(objectDeclaration, objectData);
                    }
                    else if (objectDeclaration.ObjectPartitionID.DecodedValue == 1)
                    {
                        revisionObject.PropertySet = new PropertySetObject(objectDeclaration, objectData);
                        if (Convert.ToBoolean(revisionObject.JCID.JCID.IsFileData) == false)
                        {
                            revisionObject.ReferencedObjectID       = objectData.ObjectExGUIDArray;
                            revisionObject.ReferencedObjectSpacesID = objectData.CellIDArray;
                        }
                    }
                }

                for (int i = 0; i < dataObject.ObjectGroupDeclarations.ObjectGroupObjectBLOBDataDeclarationList.Count; i++)
                {
                    ObjectGroupObjectBLOBDataDeclaration objectGroupObjectBLOBDataDeclaration = dataObject.ObjectGroupDeclarations.ObjectGroupObjectBLOBDataDeclarationList[i];
                    ObjectGroupObjectDataBLOBReference   objectGroupObjectDataBLOBReference   = dataObject.ObjectGroupData.ObjectGroupObjectDataBLOBReferenceList[i];
                    if (!objectDict.ContainsKey(objectGroupObjectBLOBDataDeclaration.ObjectExGUID))
                    {
                        revisionObject = new RevisionStoreObject();
                        objectDict.Add(objectGroupObjectBLOBDataDeclaration.ObjectExGUID, revisionObject);
                    }
                    else
                    {
                        revisionObject = objectDict[objectGroupObjectBLOBDataDeclaration.ObjectExGUID];
                    }
                    if (objectGroupObjectBLOBDataDeclaration.ObjectPartitionID.DecodedValue == 2)
                    {
                        revisionObject.FileDataObject = new FileDataObject();
                        revisionObject.FileDataObject.ObjectDataBLOBDeclaration = objectGroupObjectBLOBDataDeclaration;
                        revisionObject.FileDataObject.ObjectDataBLOBReference   = objectGroupObjectDataBLOBReference;
                    }
                }
                objectGroup.Objects.AddRange(objectDict.Values.ToArray());
            }
            else
            {
                for (int i = 0; i < dataObject.ObjectGroupDeclarations.ObjectDeclarationList.Count; i++)
                {
                    ObjectGroupObjectDeclare objectDeclaration = dataObject.ObjectGroupDeclarations.ObjectDeclarationList[i];
                    ObjectGroupObjectData    objectData        = dataObject.ObjectGroupData.ObjectGroupObjectDataList[i];

                    if (objectDeclaration.ObjectPartitionID.DecodedValue == 1)
                    {
                        EncryptionObject encrypObject = new EncryptionObject();
                        encrypObject.ObjectDeclaration = objectDeclaration;
                        encrypObject.ObjectData        = objectData.Data.Content.ToArray();
                        objectGroup.EncryptionObjects.Add(encrypObject);
                    }
                }
            }

            return(objectGroup);
        }
コード例 #2
0
        /// <summary>
        /// This method is used to test Object Data BLOB Reference related adapter requirements.
        /// </summary>
        /// <param name="instance">Specify the instance which need to be verified.</param> 
        /// <param name="site">Specify the ITestSite instance.</param>
        public void VerifyObjectGroupObjectDataBLOBReference(ObjectGroupObjectDataBLOBReference instance, ITestSite site)
        {
            // If the instance is not null and there are no parsing errors, then the DataElementFragment related adapter requirements can be directly captured.
            if (null == instance)
            {
                site.Assert.Fail("The instance of type DataElementFragment is null due to parsing error or type casting error.");
            }

            // Verify the stream object header related requirements.
            this.ExpectStreamObjectHeaderStart(instance.StreamObjectHeaderStart, instance.GetType(), site);

            // Directly capture requirement MS-FSSHTTPB_R332, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     332,
                     @"[In Object Data BLOB Reference] Object Group Object Data BLOB Reference (variable): A 16-bit (section 2.2.1.5.1) or 32-bit stream object header (section 2.2.1.5.2) that specifies an object group object data BLOB reference (section 2.2.1.12.6.5).");

            // Directly capture requirement MS-FSSHTTPB_R333, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     333,
                     @"[In Object Data BLOB Reference] Object Extended GUID Array (variable): An extended GUID array (section 2.2.1.8) that specifies the object references.");

            // Directly capture requirement MS-FSSHTTPB_R334, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     334,
                     @"[In Object Data BLOB Reference] Cell ID Array (variable): A cell ID array (section 2.2.1.11) that specifies the cell references.");

            // Directly capture requirement MS-FSSHTTPB_R335, if there are no parsing errors. 
            site.CaptureRequirement(
                     "MS-FSSHTTPB",
                     335,
                     @"[In Object Data BLOB Reference] BLOB Extended GUID (variable): An extended GUID (section 2.2.1.7) that specifies the object data BLOB.");

            // Verify the stream object header related requirements.
            this.ExpectSingleObject(instance.StreamObjectHeaderStart, site);
        }