Пример #1
0
        private string GetFullPath(ProjectIteration parentItem, string name)
        {
            string result = name;

            while (parentItem != null)
            {
                result = parentItem.Name + "\\" + result;
                parentItem = parentItem.ParentProjectIteration;
            }

            if (result.ToLower().StartsWith("iteration\\"))
            {
                result = result.Remove(0, result.IndexOf('\\') + 1);
            }

            return this.FormatIterationName(result);
        }
Пример #2
0
        private List<ProjectIteration> LoadIterations(XmlNode parentNode, ProjectIteration parentItem = null)
        {
            var result = new List<ProjectIteration>();

            foreach (XmlNode item in parentNode.ChildNodes)
            {
                if (item.Name == "Children")
                {
                    result = this.LoadIterations(item, parentItem);
                }
                else
                {
                    string nodeId = this.GetNodeID(item.OuterXml);
                    NodeInfo nodeInfo = this.commonStructureService.GetNode(nodeId);

                    var pi = new ProjectIteration
                    {
                        Name = nodeInfo.Name,
                        StartDate = nodeInfo.StartDate,
                        FinishDate = nodeInfo.FinishDate,
                        ParentUri = nodeInfo.ParentUri,
                        Path = nodeInfo.Path,
                        ProjectUri = nodeInfo.ProjectUri,
                        StructureType = nodeInfo.StructureType,
                        Uri = nodeInfo.Uri,
                        FullPath = this.GetFullPath(parentItem, nodeInfo.Name),
                        ParentProjectIteration = parentItem
                    };
                    pi.Children = this.LoadIterations(item, pi);
                    result.Add(pi);
                }
            }

            return result;
        }
Пример #3
0
 public void DeleteIteration(ProjectIteration projectIteration)
 {
     if (projectIteration != null)
     {
         this.commonStructureService.DeleteBranches(new[] { projectIteration.Uri }, projectIteration.ParentUri);
     }
     else
     {
         throw new ArgumentNullException("projectIteration", "A valid Project Iteration is required to perform a delete");
     }
 }