我需要在“我的查询”文件夹中获取 TFS 2012 中的查询。我找到了这篇文章。但是接下来会给出所有的查询。
我想从“我的查询”文件夹中获取查询。这是我到目前为止所尝试的:
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 as QueryFolder;
QueryItem queryItem = queryFolder[folder];
queryFolder = queryItem as QueryFolder;
}
当我添加queryFolder
观看时,它会给出以下输出:
我如何访问结果并获得这些值?