c# - 以编程方式打开 TFS 工作项 UI

标签 c# tfs

我目前正在 Outlook 中制作一个插件,我希望能够使用指定的模板(错误/任务/等)打开工作项并填充一些字段。但我不知道如何调用用户界面。 (这就像当您在 Excel 中并导入 TFS 时,您的项目未验证,因此它会在 UI 中打开工作项目)

命名空间或代码将不胜感激。

最佳答案

我看到隐藏的“复制模板 URL”按钮的解决方案位于我使用的 URL 中:

http://tfsportal.com/CompanyName/ProjectName/_layouts/tswa/UI/Pages/WorkItems/WorkItemEdit.aspx <- 不显示按钮。

http://tfs.CompanyNameURL:8080/tfs/web/wi.aspx ? <- 确实显示按钮

一旦您获得 URL,您就可以轻松 Shell the process in .Net 。例如:

string URL = the TFSWorkItemURLYouGotFromThewi.aspxPageWithQueryStrings
Process.Start(URL):

仅供引用:另一种方法是使用 Process 类的实例。这允许对进程进行更多控制,包括调度、它将运行的窗口类型,以及对我来说最有用的是等待进程完成的能力。

Process process = new Process();
// Configure the process using the StartInfo properties.
process.StartInfo.FileName = "process.exe";
process.StartInfo.Arguments = "-n";
process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
process.Start();
process.WaitForExit();// Waits here for the process to exit.

关于c# - 以编程方式打开 TFS 工作项 UI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11588847/

相关文章:

c# - 整个网站从 Http 迁移到 Https

c# - 使用 Func<,> 构建 LambdaExpression,其中 returnType 为 IQueryable<T>

javascript - 什么是具有出色雪崩性的简单可逆非密码字符串密码函数?

c# 捕获 Ctrl+PageUp 击键

c# - 通过 javascript 启用/禁用 asp.net 复选框

git - Visual Studio 一直要求安装 Git 命令提示工具

sql-server - TFS 2013 和 SQL Server 2014 版本冲突

git - 将评论添加到 TFS Git pull 请求时是否可以收到通知?

Azure 托管的本地构建 Controller + VSO : Error TF400106: Failed to register the build service (Exception Message: Could not find service)

testing - 从用户故事到测试的 TFS(敏捷)工作项