public string[] GetScrumTeams(TeamFoundationServer tfs, string tfsProject)
{ ArrayList teams = HttpRuntime.Cache["_scrum_TeamCache"] as ArrayList;
if (teams == null)
{ teams = new ArrayList();
WorkItemStore workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
XmlDocument doc = workItemStore.ExportGlobalLists();
XmlNode node = doc.SelectSingleNode("//GLOBALLIST[@name='Teams - " + tfsProject + "']"); if (node == null)
return new string[] { };
foreach (XmlNode listItem in node.ChildNodes)
{ teams.Add(listItem.Attributes["value"].Value);
}
HttpRuntime.Cache.Add("_scrum_TeamCache", teams, null, DateTime.Now.AddHours(1), Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Default, null); }
return (string[])teams.ToArray(typeof(string));
}