예제 #1
0
 public void Add(TfsField field)
 {
     if (fields.Contains(field) == false)
     {
         fields.Add(field);
     }
 }
예제 #2
0
 public void Add(TfsField field)
 {
     if (fields.Contains(field) == false)
     {
         fields.Add(field);
     }
 }
예제 #3
0
 private void assignToField(WorkItem workItem, string fieldName, object value)
 {
     if (value != null && string.IsNullOrEmpty(value.ToString()) == false)
     {
         TfsField field = fields[fieldName];
         if (field != null && workItem.Fields.Contains(fieldName))
         {
             workItem.Fields[fieldName].Value = field.ToFieldValue(value);
         }
     }
 }
예제 #4
0
        public TfsProject(string serverUri, string project)
        {
            this.serverUri    = serverUri;
            tfs               = null;
            this.project      = project;
            supportsHtml      = false;
            failedAttachments = false;
            importSummary     = new ImportSummary();

            if (string.IsNullOrWhiteSpace(serverUri) == false)
            {
                tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(serverUri));
            }

            fields   = TfsFieldFactory.GetFieldsFor(tfs, project);
            tfsUsers = new TfsUsers(this);

            if (tfs != null)
            {
                var workItemStore = tfs.GetService <WorkItemStore>();

                TfsField descriptionField = fields["Description"];
                if (descriptionField != null)
                {
                    supportsHtml = descriptionField.SupportsHtml;
                }
                tfsUsers.OnFailedToImpersonate += OnWarn;

                areaPaths = new List <string> {
                    this.project
                };
                foreach (Node area in workItemStore.Projects[this.project].AreaRootNodes)
                {
                    areaPaths.Add(area.Path);
                    foreach (Node item in area.ChildNodes)
                    {
                        areaPaths.Add(item.Path);
                    }
                }

                processTemplateName = getProcessTemplateName(this.project);
            }
        }
예제 #5
0
        public List <string> AllowedValuesForField(string fieldName)
        {
            TfsField field = fields[fieldName];

            return(field != null ? field.AllowedValues : new List <String>());
        }