tfs2010 - how to get saved queries in tfs 2012 using c# -
i need queries in tfs 2012 in "my queries" folder. found this article. following gives queries.
i want queries "my queries" folder. have tried far:
string selectedproject = this.listprojects.selecteditem.tostring(); tfsteamprojectcollection teamprojectcollection = tfsdetail.getteamprojectdetails(urlpath); if (teamprojectcollection != null) { project detailsoftheselectedproject = null; workitemstore workitemstore = (workitemstore)teamprojectcollection.getservice(typeof(workitemstore)); string folder = "my queries"; var project = workitemstore.projects[selectedproject]; queryhierarchy queryhierarchy = project.queryhierarchy; var queryfolder = queryhierarchy queryfolder; queryitem queryitem = queryfolder[folder]; queryfolder = queryitem queryfolder; }
when add queryfolder
watch gives following output:
how access result , values?
i solved problem following way:
var project = workitemstore.projects[selectedproject]; queryhierarchy queryhierarchy = project.queryhierarchy; var queryfolder = queryhierarchy queryfolder; queryitem queryitem = queryfolder[folder]; queryfolder = queryitem queryfolder; foreach (var item in queryfolder) { listqueries.items.add(item.name); }
Comments
Post a Comment