当前位置: 首页>>代码示例>>C#>>正文


C# PropertySet.Set方法代码示例

本文整理汇总了C#中PropertySet.Set方法的典型用法代码示例。如果您正苦于以下问题:C# PropertySet.Set方法的具体用法?C# PropertySet.Set怎么用?C# PropertySet.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PropertySet的用法示例。


在下文中一共展示了PropertySet.Set方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: createTestVirtualDocument

        private void createTestVirtualDocument()
        {
                // create a new DataObject to use as the parent node
                ObjectIdentity emptyIdentity = new ObjectIdentity(DefaultRepository);
                DataObject parentDO = new DataObject(emptyIdentity);
                parentDO.Type = "dm_document";
                PropertySet parentProperties = new PropertySet();
                parentProperties.Set("object_name", SampleContentManager.testVdmObjectName);
                parentDO.Properties = parentProperties;

                // link into a folder
                ObjectPath objectPath = new ObjectPath(SampleContentManager.sourcePath);
                ObjectIdentity sampleFolderIdentity = new ObjectIdentity(objectPath, DefaultRepository);
                ReferenceRelationship sampleFolderRelationship = new ReferenceRelationship();
                sampleFolderRelationship.Name = Relationship.RELATIONSHIP_FOLDER;
                sampleFolderRelationship.Target = sampleFolderIdentity;
                sampleFolderRelationship.TargetRole = Relationship.ROLE_PARENT;
                parentDO.Relationships.Add(sampleFolderRelationship);

                // get id of document to use for first child node
                ObjectIdentity child0Id = new ObjectIdentity();
                child0Id.RepositoryName = DefaultRepository;
                child0Id.Value = new Qualification(SampleContentManager.gifImageQualString);

                // get id of document to use for second child node
                ObjectIdentity child1Id = new ObjectIdentity();
                child1Id.RepositoryName = DefaultRepository;
                child1Id.Value = new Qualification(SampleContentManager.gifImage1QualString);

                ObjectIdentitySet childNodes = new ObjectIdentitySet();
                childNodes.AddIdentity(child0Id);
                childNodes.AddIdentity(child1Id);

                virtualDocumentServiceDemo.AddChildNodes(parentDO, childNodes);
        }
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:35,代码来源:TVirtualDocumentServiceDemo.cs

示例2: ShowNumberProperties

        public void ShowNumberProperties()
        {
            PropertySet propertySet = new PropertySet();

            //Create instances of NumberProperty
            propertySet.Set("TestShortName", (short) 10);
            propertySet.Set("TestIntegerName", 10);
            propertySet.Set("TestLongName", 10L);
            propertySet.Set("TestDoubleName", 10.10);

            //Create instance of DateProperty
            propertySet.Set("TestDateName", new DateTime());

            //Create instance of BooleanProperty
            propertySet.Set("TestBooleanName", false);

            //Create instance of ObjectIdProperty
            propertySet.Set("TestObjectIdName", new ObjectId("10"));

            List<Property> properties = propertySet.Properties;
            foreach (Property p in properties)
            {
                Console.WriteLine(typeof(Property).ToString() +
                                  " = " +
                                  p.GetValueAsString());
            }
        }
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:27,代码来源:PropertyDemo.cs

示例3: ShowPropertySet

 public PropertySet ShowPropertySet()
 {
     Property[] properties =
         {
             new StringProperty("subject", "dangers"),
             new StringProperty("title", "Dangers"),
             new StringArrayProperty("keywords", new String[]{"lions", "tigers", "bears"}),
         };
     PropertySet propertySet = new PropertySet();
     foreach (Property property in properties)
     {
         propertySet.Set(property);
     }
     return propertySet;
 }
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:15,代码来源:PropertyDemo.cs

示例4: UpdateRepeatProperty

        public DataPackage UpdateRepeatProperty(ObjectIdentity objectIdentity)
        {
            PropertyProfile propertyProfile = new PropertyProfile();

            // Setting the filter to ALL can cause errors if the DataObject
            // passed to the operation contains system properties, so to be safe 
            // set the filter to ALL_NON_SYSTEM unless you explicitly want to update
            // a system property
            propertyProfile.FilterMode = PropertyFilterMode.ALL_NON_SYSTEM;
            DemoServiceContext.SetProfile(propertyProfile);

            DataObject dataObject = new DataObject(objectIdentity);

            String[] moreDangers = { "snakes", "sharks" };
            ArrayProperty<string> keywordProperty = new StringArrayProperty("keywords", moreDangers);
            Console.WriteLine("Appending additional strings 'snakes' and 'sharks' to object keywords.");

            ValueAction appendAction = new ValueAction(ValueActionType.INSERT, 0);
            ValueAction deleteAction = new ValueAction(ValueActionType.APPEND, 1);
            keywordProperty.SetValueActions(appendAction, deleteAction);
            PropertySet properties = new PropertySet();
            properties.Set(keywordProperty);
            dataObject.Properties = properties;

            OperationOptions operationOptions = null;
            return objectService.Update(new DataPackage(dataObject), operationOptions);
        }
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:27,代码来源:ObjectServiceDemo.cs

示例5: UpdateFetchedObjectProperties

        public DataPackage UpdateFetchedObjectProperties(ObjectIdentity objectIdentity,
                                                         String newTitle,
                                                         String newSubject,
                                                         String[] newKeywords)
        {
            PropertyProfile propertyProfile = new PropertyProfile();

            // Setting the filter to ALL can cause errors if the DataObject
            // passed to the operation contains system properties, so to be safe 
            // set the filter to ALL_NON_SYSTEM unless you explicitly want to update
            // a system property
            propertyProfile.FilterMode = PropertyFilterMode.ALL_NON_SYSTEM;
            DemoServiceContext.SetProfile(propertyProfile);

            OperationOptions operationOptions = null;
            DataPackage dP = objectService.Get(new ObjectIdentitySet(objectIdentity), operationOptions);
            DataObject dataObject = dP.DataObjects[0];

            PropertySet properties = new PropertySet();
            properties.Set("title", newTitle);
            properties.Set("subject", newSubject);
            properties.Set("keywords", newKeywords);
            dataObject.Properties = properties;

            return objectService.Update(new DataPackage(dataObject), operationOptions);
        }
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:26,代码来源:ObjectServiceDemo.cs

示例6: CreateFolderAndLinkedDoc

        public DataPackage CreateFolderAndLinkedDoc()
        {
            // create a folder data object
            String folderName = "a-test-folder-" + System.DateTime.Now.Ticks;
            DataObject folderDataObj = new DataObject(new ObjectIdentity(DefaultRepository), "dm_folder");
            PropertySet folderDataObjProperties = new PropertySet();
            folderDataObjProperties.Set("object_name", folderName);
            folderDataObj.Properties = folderDataObjProperties;

            // create a contentless document DataObject
            String doc1Name = "a-test-doc-" + System.DateTime.Now.Ticks;
            DataObject docDataObj = new DataObject(new ObjectIdentity(DefaultRepository), "dm_document");
            PropertySet properties = new PropertySet();
            properties.Set("object_name", doc1Name);
            docDataObj.Properties = properties;

            // add the folder as a parent of the folder
            ObjectRelationship objRelationship = new ObjectRelationship();
            objRelationship.Target = folderDataObj;
            objRelationship.Name = Relationship.RELATIONSHIP_FOLDER;
            objRelationship.TargetRole = Relationship.ROLE_PARENT;
            docDataObj.Relationships.Add(new ObjectRelationship(objRelationship));

            // set up the relationship filter to return the doc and folder
            RelationshipProfile relationProfile = new RelationshipProfile();
            relationProfile.ResultDataMode = ResultDataMode.REFERENCE;
            relationProfile.TargetRoleFilter = TargetRoleFilter.ANY;
            relationProfile.NameFilter = RelationshipNameFilter.ANY;
            relationProfile.DepthFilter = DepthFilter.SPECIFIED;
            relationProfile.Depth = 2;
            OperationOptions operationOptions = new OperationOptions();
            operationOptions.RelationshipProfile = relationProfile;

            // create the folder and linked document
            DataPackage dataPackage = new DataPackage();
            dataPackage.AddDataObject(docDataObj);
            return objectService.Create(dataPackage, operationOptions);
        }
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:38,代码来源:ObjectServiceDemo.cs

示例7: CreateNewFolder

        public DataPackage CreateNewFolder()
        {
            ObjectIdentity folderIdentity = new ObjectIdentity();
            folderIdentity.RepositoryName = DefaultRepository;
            DataObject dataObject = new DataObject(folderIdentity, "dm_folder");
            PropertySet properties = new PropertySet();
            String folderName = "aTestFolder-" + System.DateTime.Now.Ticks;
            properties.Set("object_name", folderName);
            dataObject.Properties = properties;

            DataPackage dataPackage = new DataPackage(dataObject);

            OperationOptions operationOptions = null;
            return objectService.Create(dataPackage, operationOptions);
        }
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:15,代码来源:ObjectServiceDemo.cs

示例8: CreateContentlessDocument

        public DataPackage CreateContentlessDocument()
        {
            ObjectIdentity objectIdentity = new ObjectIdentity(DefaultRepository);
            DataObject dataObject = new DataObject(objectIdentity, "dm_document");
            PropertySet properties = new PropertySet();
            properties.Set("object_name", "contentless-" + System.DateTime.Now.Ticks);
            dataObject.Properties = properties;
            DataPackage dataPackage = new DataPackage(dataObject);

            OperationOptions operationOptions = null;
            return objectService.Create(dataPackage, operationOptions);
        }
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:12,代码来源:ObjectServiceDemo.cs

示例9: CreateSnapshotDemo

        public DataObject CreateSnapshotDemo(String vdmQualString, String snapshotName, String sourcePath)
        {
            // create ObjectIdentity of existing virtual document
            ObjectIdentity testVdmId = new ObjectIdentity();
            testVdmId.RepositoryName = DefaultRepository;
            testVdmId.Value = new Qualification(vdmQualString);

            // create a new DataObject to use for the snapshot
            ObjectIdentity emptyIdentity = new ObjectIdentity(DefaultRepository);
            DataObject snapshotDO = new DataObject(emptyIdentity);
            snapshotDO.Type = "dm_document";
            PropertySet parentProperties = new PropertySet();
            parentProperties.Set("object_name", snapshotName);
            snapshotDO.Properties = parentProperties;

            // link into a folder
            ObjectPath objectPath = new ObjectPath(sourcePath);
            ObjectIdentity sampleFolderIdentity = new ObjectIdentity(objectPath, DefaultRepository);
            ReferenceRelationship sampleFolderRelationship = new ReferenceRelationship();
            sampleFolderRelationship.Name = Relationship.RELATIONSHIP_FOLDER;
            sampleFolderRelationship.Target = sampleFolderIdentity;
            sampleFolderRelationship.TargetRole = Relationship.ROLE_PARENT;
            snapshotDO.Relationships.Add(sampleFolderRelationship);

            // options are reserved for future use so just pass null
            OperationOptions options = null;
            return virtualDocumentService.CreateSnapshot(testVdmId, snapshotDO, options);
        }
开发者ID:danieldoboseru,项目名称:network-spider,代码行数:28,代码来源:VirtualDocumentServiceDemo.cs


注:本文中的PropertySet.Set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。