【问题标题】:Open the TFS Workitem UI Programmatically以编程方式打开 TFS 工作项 UI
【发布时间】:2012-07-21 10:40:31
【问题描述】:

我目前正在 Outlook 中制作一个插件,我想制作它以便使用指定的模板(错误/任务/等)打开一个工作项并填充一些字段。我不知道如何调用 UI。 (这就像您在 excel 中并导入 TFS 并且您的项目未验证,因此它在 UI 中打开工作项)

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

【问题讨论】:

    标签: c# tfs


    【解决方案1】:

    我看到隐藏的“复制模板 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.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-29
      • 2011-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-09
      相关资源
      最近更新 更多