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


C# Asset.SetAttributeValue方法代码示例

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


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

示例1: CreateTeam

        protected Asset CreateTeam(string name)
        {
            var teamNameDef = MetaModel.GetAttributeDefinition("Team.Name");

            var assetTeam = new Asset(MetaModel.GetAssetType("Team"));
            assetTeam.SetAttributeValue(teamNameDef, name);
            Services.Save(assetTeam);

            return assetTeam;
        }
开发者ID:marcinczekaj,项目名称:v1-jira-integration,代码行数:10,代码来源:BaseIntegrationTester.cs

示例2: UpdateOpenTest

        private void UpdateOpenTest(Oid newStatus, Asset test) {
            var statusAttribute = test.GetAttribute(TestStatusDef);
            var statusOid = (Oid)statusAttribute.Value;

            if(newStatus != statusOid) {
                test.SetAttributeValue(TestStatusDef, newStatus);
                Services.Save(test, changeComment);
                Logger.Log(string.Format("Updating status of Acceptance Test \"{0}\".", test.Oid.Token));
            }
        }
开发者ID:versionone,项目名称:VersionOne.Integration.HPALM,代码行数:10,代码来源:TestWriterService.cs

示例3: CreateSprint

        protected Asset CreateSprint(string name, Oid scheduleOid)
        {
            var timeboxNameDef = MetaModel.GetAttributeDefinition("Timebox.Name");
            var timeboxEndDateDef = MetaModel.GetAttributeDefinition("Timebox.EndDate");
            var timeboxBeginDateDef = MetaModel.GetAttributeDefinition("Timebox.BeginDate");
            var timeboxStateDef = MetaModel.GetAttributeDefinition("Timebox.State");
            var timeboxScheduleDef = MetaModel.GetAttributeDefinition("Timebox.Schedule");

            var assetTimeBox = new Asset(MetaModel.GetAssetType("Timebox"));
            assetTimeBox.SetAttributeValue(timeboxNameDef, name);
            assetTimeBox.SetAttributeValue(timeboxEndDateDef, DateTime.Now.AddDays(5));
            assetTimeBox.SetAttributeValue(timeboxBeginDateDef, DateTime.Now);
            assetTimeBox.SetAttributeValue(timeboxStateDef, Oid.FromToken("State:100", MetaModel));
            assetTimeBox.SetAttributeValue(timeboxScheduleDef, scheduleOid.Momentless.Token);
            Services.Save(assetTimeBox);

            return assetTimeBox;
        }
开发者ID:marcinczekaj,项目名称:v1-jira-integration,代码行数:18,代码来源:BaseIntegrationTester.cs

示例4: CreateStory

        protected Asset CreateStory(string name, string description, Oid scopeOid, Oid featureGroupOid, Oid teamOid, Oid sprintOid)
        {
            var storyNameDef = MetaModel.GetAttributeDefinition("Story.Name");
            var storyScopeDef = MetaModel.GetAttributeDefinition("Story.Scope");
            var storyDescDef = MetaModel.GetAttributeDefinition("Story.Description");
            var storyParentDef = MetaModel.GetAttributeDefinition("Story.Parent");
            var storyTeamDef = MetaModel.GetAttributeDefinition("Story.Team");
            var storyTimeBoxDef = MetaModel.GetAttributeDefinition("Story.Timebox");

            var assetStory = new Asset(MetaModel.GetAssetType("Story"));
            assetStory.SetAttributeValue(storyNameDef, name);
            assetStory.SetAttributeValue(storyScopeDef, scopeOid);
            assetStory.SetAttributeValue(storyDescDef, description);
            if (featureGroupOid != null) {
                assetStory.SetAttributeValue(storyParentDef, featureGroupOid.Momentless.Token);
            }
            if (teamOid != null) {
                assetStory.SetAttributeValue(storyTeamDef, teamOid.Momentless.Token);
            }
            if (sprintOid != null) {
                assetStory.SetAttributeValue(storyTimeBoxDef, sprintOid.Momentless.Token);
            }
            Services.Save(assetStory);

            return assetStory;
        }
开发者ID:marcinczekaj,项目名称:v1-jira-integration,代码行数:26,代码来源:BaseIntegrationTester.cs

示例5: CreateProject

        protected Asset CreateProject(string scopeName, Oid scheduleOid, string parentProjectToken)
        {
            var scopeNameDef = MetaModel.GetAttributeDefinition("Scope.Name");
            var scopeParentIdDef = MetaModel.GetAttributeDefinition("Scope.Parent");
            var scopeBeginDateDef = MetaModel.GetAttributeDefinition("Scope.BeginDate");
            var scopeScheduleDef = MetaModel.GetAttributeDefinition("Scope.Schedule");

            var assetScope = new Asset(MetaModel.GetAssetType("Scope"));
            assetScope.SetAttributeValue(scopeNameDef, scopeName);
            assetScope.SetAttributeValue(scopeParentIdDef, Oid.FromToken(parentProjectToken, MetaModel));
            assetScope.SetAttributeValue(scopeBeginDateDef, DateTime.Now);

            if (scheduleOid != null) {
                assetScope.SetAttributeValue(scopeScheduleDef, scheduleOid.Momentless.Token);
            }

            Services.Save(assetScope);

            return assetScope;
        }
开发者ID:marcinczekaj,项目名称:v1-jira-integration,代码行数:20,代码来源:BaseIntegrationTester.cs

示例6: CreateSchedule

        protected Asset CreateSchedule(string name)
        {
            var scheduleNameDef = MetaModel.GetAttributeDefinition("Schedule.Name");
            var scheduleTimeboxGapDef = MetaModel.GetAttributeDefinition("Schedule.TimeboxGap");
            var scheduleTimeboxLengthDef = MetaModel.GetAttributeDefinition("Schedule.TimeboxLength");

            var assetSchedule = new Asset(MetaModel.GetAssetType("Schedule"));
            assetSchedule.SetAttributeValue(scheduleNameDef, name);
            assetSchedule.SetAttributeValue(scheduleTimeboxGapDef, "0 Days");
            assetSchedule.SetAttributeValue(scheduleTimeboxLengthDef, "14 Days");
            Services.Save(assetSchedule);

            return assetSchedule;
        }
开发者ID:marcinczekaj,项目名称:v1-jira-integration,代码行数:14,代码来源:BaseIntegrationTester.cs

示例7: CreateFeatureGroup

        protected Asset CreateFeatureGroup(string name, Oid scopeOid, Oid parentFGroup)
        {
            var themeNameDef = MetaModel.GetAttributeDefinition("Theme.Name");
            var themeScopeDef = MetaModel.GetAttributeDefinition("Theme.Scope");
            var themeParentDef = MetaModel.GetAttributeDefinition("Theme.Parent");

            var assetFGroup = new Asset(MetaModel.GetAssetType("Theme"));
            assetFGroup.SetAttributeValue(themeNameDef, name);
            assetFGroup.SetAttributeValue(themeScopeDef, scopeOid);
            if (parentFGroup != null) {
                assetFGroup.SetAttributeValue(themeParentDef, parentFGroup.Momentless.Token);
            }
            Services.Save(assetFGroup);

            return assetFGroup;
        }
开发者ID:marcinczekaj,项目名称:v1-jira-integration,代码行数:16,代码来源:BaseIntegrationTester.cs

示例8: CreateDefect

        protected Asset CreateDefect(string name, string description, Oid scopeOid, Oid featureGroupOid, Oid teamOid, Oid sprintOid)
        {
            var defectNameDef = MetaModel.GetAttributeDefinition("Defect.Name");
            var defectScopeDef = MetaModel.GetAttributeDefinition("Defect.Scope");
            var defectDescDef = MetaModel.GetAttributeDefinition("Defect.Description");
            var defectParentDef = MetaModel.GetAttributeDefinition("Defect.Parent");
            var defectTeamDef = MetaModel.GetAttributeDefinition("Defect.Team");
            var defectTimeBoxDef = MetaModel.GetAttributeDefinition("Defect.Timebox");

            var assetDefect = new Asset(MetaModel.GetAssetType("Defect"));
            assetDefect.SetAttributeValue(defectNameDef, name);
            assetDefect.SetAttributeValue(defectScopeDef, scopeOid);
            assetDefect.SetAttributeValue(defectDescDef, description);

            if (featureGroupOid != null) {
                assetDefect.SetAttributeValue(defectParentDef, featureGroupOid.Momentless.Token);
            }
            if (teamOid != null) {
                assetDefect.SetAttributeValue(defectTeamDef, teamOid.Momentless.Token);
            }
            if (sprintOid != null) {
                assetDefect.SetAttributeValue(defectTimeBoxDef, sprintOid.Momentless.Token);
            }
            Services.Save(assetDefect);

            return assetDefect;
        }
开发者ID:marcinczekaj,项目名称:v1-jira-integration,代码行数:27,代码来源:BaseIntegrationTester.cs

示例9: CreateWorkitemStatus

        public ValueId CreateWorkitemStatus(string statusName)
        {
            try {
                var primaryWorkitemStatusType = metaModel.GetAssetType(WorkitemStatusType);
                var status = new Asset(primaryWorkitemStatusType);
                status.SetAttributeValue(primaryWorkitemStatusType.NameAttribute, statusName);
                services.Save(status);

                return new ValueId(status.Oid.Momentless, statusName);
            } catch (V1Exception ex) {
                throw new VersionOneException(queryBuilder.Localize(ex.Message));
            } catch(Exception ex) {
                throw new VersionOneException(ex.Message);
            }
        }
开发者ID:marcinczekaj,项目名称:v1-jira-integration,代码行数:15,代码来源:VersionOneProcessor.cs

示例10: SetAssetAttribute

 private static void SetAssetAttribute(Asset asset, string attrName, object value) {
     var type = asset.AssetType;
     var def = type.GetAttributeDefinition(attrName);
     
     if (value == null || (value is Oid && value.Equals(Oid.Null))) {
         asset.EnsureAttribute(def);
     } else {
         asset.SetAttributeValue(def, value);
     }
 }
开发者ID:cagatayalkan,项目名称:VersionOne.Client.VisualStudio,代码行数:10,代码来源:AssetFactory.cs

示例11: SaveChangeSetAsset

        private Asset SaveChangeSetAsset(Asset changeSet, ChangeSetInfo info, IEnumerable<Oid> primaryworkitems) 
        {
            changeSet.SetAttributeValue(ChangeSetNameDef, string.Format("'{0}' on '{1}'", info.Author, GetFormattedTime(info.ChangeDate)));
            changeSet.SetAttributeValue(ChangeSetDescriptionDef, info.Message);

            foreach(Oid oid in primaryworkitems) 
            {
                changeSet.AddAttributeValue(ChangeSetPrimaryWorkitemsDef, oid);
            }

            V1Connection.Data.Save(changeSet, changecomment);
            return changeSet;
        }
开发者ID:njmyi,项目名称:VersionOne.Integration.Subversion,代码行数:13,代码来源:ChangeSetWriterService.cs


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