public static IEnumerable <IterationItem> GetIterationsWithDates(this ICommonStructureService4 css, string projectUri) { NodeInfo[] structures = css.ListStructures(projectUri); NodeInfo iterations = structures.FirstOrDefault(n => n.StructureType.Equals("ProjectLifecycle")); List <IterationItem> schedule = null; if (iterations != null) { string projectName = css.GetProject(projectUri).Name; XmlElement iterationsTree = css.GetNodesXml(new[] { iterations.Uri }, true); GetIterationDates(iterationsTree.ChildNodes[0], projectName, ref schedule); } return(schedule); }
private static IEnumerable<ScheduleInfo> GetIterationDates(ICommonStructureService4 css, string projectUri) { NodeInfo[] structures = css.ListStructures(projectUri); NodeInfo iterations = structures.FirstOrDefault(n => n.StructureType.Equals("ProjectLifecycle")); List<ScheduleInfo> schedule = null; if (iterations != null) { string projectName = css.GetProject(projectUri).Name; XmlElement iterationsTree = css.GetNodesXml(new[] { iterations.Uri }, true); GetIterationDates(iterationsTree.ChildNodes[0], projectName, ref schedule); } return schedule.Where(s => s.StartDate != null && s.EndDate != null); }