TFS 客户端挂钩 [英] TFS Client side hook

查看:30
本文介绍了TFS 客户端挂钩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用 TFS 作为版本控制.目前,项目管理是通过我们本地的 PMS 应用程序完成的.我们有一个要求,例如当团队成员签入项目时,显示用于输入任务详细信息的自定义对话框并更新我们的本地 pms 数据库.我想显示一个自定义对话框,在调用签入命令之后和/或之后.还要确保只有通过这个自定义对话框成功提交了任务详情,我们才能签入项目.

We have using TFS as version control. Currently the project management is done through our local PMS application. We have a requirement like when a team member check in the project, show a custom dialog for entering task details and update our local pms database. I want to show a custom dialog box that and/or after the check-in command is invoked. Also ensure that only successful submission of task details through this custom dialog boxes, we can checkin the projects.

推荐答案

创建自己的签入策略

您可以通过签到政策执行此操作.查看我关于与用户交互的博客文章办理入住手续时.基本技巧是引发用户可以单击的签入警告,在单击事件上,您可以向用户显示 UI 并使用标准的 Windows 窗体功能与您的系统进行交互.

Creating your own checkin policy

You can do this through a Check-in policy. Check out my blog post on interacting with the user on check-in. The basic trick is to raise a check-in warning which the user can click, on the click event, you can show UI to the user and use standard Windows Forms functionality to interact with your system.

基本示例代码可以在这个StackOverflow问题中找到.

我的多分支策略使用这个技巧要求用户确认用户是否真的想同时将代码签入到多个分支,而不必使用绕过策略验证复选框.

My multiple Branch policy uses this trick to ask a user to confirm whether the user really wants to check in code to multiple branches at the same time without having to use the bypass policy validation checkbox.

配置 Team 项目使用签入策略后,如果签入时机器上未安装该策略,Visual Studio 会报错.没有简单的方法来分发签入策略以确保每个用户都在他们的机器上安装了它,或者会自动从 TFS 安装它.

After configuring the Team project to use the checkin policy, Visual Studio will complain when the policy is not installed on the machine upon checkin. There is no easy way to distribute checkin policies to ensure that every user has it installed on their machine, or will automatically get it installed from TFS.

在您的签入策略中,您可以通过 IPolicyDefinition.InstallationInstructions 提供策略包位置的 URI.该包可以是 .msi.vsix 或只是一个带有脚本的 zip 文件,用于复制程序集并添加所需的注册表项.Visual Studio 不关心您选择的方法.如果您的公司托管自己的 Visual Studio 库,则它可能指向那里的下载位置也是如此.

In your checkin policy you can provide a URI to the location of the policy package through the IPolicyDefinition.InstallationInstructions. The package can be a .msi, a .vsix or just a zip file with a script to copy the assembly and add the required registry key. Visual Studio doesn't care about the method you choose. If your company hosts their own Visual Studio gallery, it could point to the download location there as well.

如果您选择 .msi,您可以通过组织中可能可用的现有配置工具分发它们.

If you pick an .msi you could have them distributed through existing provisioning tools that might be available in your organisation.

未安装该策略的客户端将在签入时自动触发警告,只有通过选中绕过签入策略"复选框才能解除该警告.该权限可以撤销,要求所有用户正确设置他们的机器.

Clients that do not have the policy installed will automatically trigger a warning on checkin that can only be dismissed by checking the "bypass checkin policy" checkbox. That permission can be revoked, requiring all users to setup their machine correctly.

还有一种分发签入策略的方法,这是通过 Visual Studio Power 工具.通过签入特定文件夹中源代码管理中的策略并告诉 Power Tools 下载自定义二进制文件(工作项控件和签入策略),它们将被自动安装.由于这些工具不是默认安装的,也不是默认配置的,它们需要大约相同的工作量才能使此方案适合您.

There is one more way to distribute checkin policies, which is through the Visual Studio Power tools. By checkin in the policies in Source Control in a specific folder and telling the Power Tools to download custom binaries (work item controls and checkin polciies), they will be installed automatically. Since these tools are not installed by default, not configured by default they need about the same amount of work to make this scenario work for you.

这篇关于TFS 客户端挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆