如何在 TFS 中以编程方式确定代码块的作者? [英] How can I determine the author of a block of code programmatically in TFS?

查看:35
本文介绍了如何在 TFS 中以编程方式确定代码块的作者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用 Team Foundation Server (Visual Studio 2010).

We are working with Team Foundation Server (Visual Studio 2010).

如何以编程方式获取特定代码块的编写者?

How can I get writer of the specific code block programmatically?

推荐答案

使用 TFS API,您或许能够获取该数据.每个变更集都有一个提交者.我会接受提供的代码 这里.从此,您可以添加:

With TFS API, you may be able to get to that data. Each changeset has a commiter. I would take the code offered up here. From this, you can add:

foreach (var change in cs.Changes)
{
    if (change.Item.ServerItem != serverItem)
    {
        return;
    }
    //Get commiter
    cs.Committer

虽然这并不能让您 100% 到达目的地,但它至少是一个起点.

While this doesn't get you 100% of the way there, it is at least a starting point.

这篇关于如何在 TFS 中以编程方式确定代码块的作者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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