Ejemplo n.º 1
0
 public TFSWorkItem(TFSProject ownerProject, ElementWrapper elementToWrap) : base(ownerProject, elementToWrap)
 {
     _TFSOwnerProject = ownerProject;
     //set default type
     if (string.IsNullOrEmpty(this.type))
     {
         if (this._TFSOwnerProject.settings.workitemMappings.ContainsKey(this.wrappedElement.wrappedElement.FQStereotype))                 //TODO add to ElementWrapper?
         {
             this.type = _TFSOwnerProject.settings.workitemMappings[this.wrappedElement.wrappedElement.FQStereotype];
         }
         else if (this._TFSOwnerProject.settings.workitemMappings.ContainsKey(this.wrappedElement.EAElementType))
         {
             this.type = _TFSOwnerProject.settings.workitemMappings[this.wrappedElement.EAElementType];
         }
         else
         {
             this.type = _TFSOwnerProject.settings.defaultWorkitemType;
         }
     }
     //set default status
     if (string.IsNullOrEmpty(this.state))
     {
         this.state = this._TFSOwnerProject.settings.defaultStatus;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// returns the project based on the currently selected element.
        /// </summary>
        /// <returns>the TFSProject based on the currently selected item</returns>
        private TFS.TFSProject getCurrentProject()
        {
            var currentProject = TFS.TFSProject.getCurrentProject(this.model.selectedElement as TSF_EA.Element, this.settings.getTFSUrl(this.EAModel), this.settings);

            if (currentProject == null)
            {
                //if not found return default project
                currentProject = new TFS.TFSProject(settings.defaultProject, this.settings.getTFSUrl(this.EAModel), this.settings);
            }
            return(currentProject);
        }
Ejemplo n.º 3
0
 public TFSWorkItem(TFSProject ownerProject, int workitemID, ListofWorkItemsResponse.Fields fields) : base(ownerProject)
 {
     _TFSOwnerProject = ownerProject;
     this.ID          = workitemID.ToString();
     this.updateTFSFields(fields);
 }