コード例 #1
0
        /// <summary>
        /// Removes the project from the selected list.  This method is invoked by the RemoveCommand.
        /// </summary>
        public void RemoveProject()
        {
            ProjectViewModel selectedProjectVM = SelectedProjects.FirstOrDefault(p => p.IsSelected == true);

            UnassignedProjects.Add(selectedProjectVM);
            SelectedProjects.Remove(selectedProjectVM);
        }
コード例 #2
0
        public List <TFSBuildDefinitionItem> GetBuildList()
        {
            _isBackgroundProcessRunning = true;
            var curPrj = SelectedProjects.FirstOrDefault();

            if (curPrj == null)
            {
                throw new ApplicationException("No one TFS project has been selected");
            }
            var buildDefs = BuildServer.QueryBuildDefinitions(curPrj.Name);

            //convert flat build list to our contracts
            var result = new List <TFSBuildDefinitionItem>(buildDefs.Length);

            foreach (var item in buildDefs)
            {
                var newDef = new TFSBuildDefinitionItem()
                {
                    Name                = item.Name,
                    HierarchyName       = item.Name.Split('.'),
                    Id                  = item.Id,
                    Description         = item.Description,
                    TFSBuildDefInstance = item,
                    LastRun             = new TFSBuildRunItem()
                    {
                        BuildStatus = BuildStatusType.None
                    }
                };

                result.Add(newDef);
            }
            _isBackgroundProcessRunning = false;
            return(result);
        }