English 中文(简体)
如何在使用TFS习俗时获得项目名称
原标题:How to get the project name when using TFS custom plugins

当我们撰写有关“TFS”原始产品的C#代码时,我们就抓住了检查活动。 我们如何能够检索项目名称,用户正在核对?

问题回答

监察组的项目名称始终是道路的第一部分。 例如,如果用户在档案中检查:

$/ExampleProject/Folder/File.txt

然后,小组项目名称为Example Project。 TFS SDK有一个助手方法,使你能够把小组项目的名称带上源控制道路:

string teamProjectName = 
    VersionControlPath.GetTeamProjectName("$/ExampleProject/Folder/File.txt");

Note that you can check into multiple team projects at the same time. For example, your pending changes can contain changes to:

$/Project1/Folder/File.txt
$/Project2/Folder/File.txt

在此情况下,用户正在对<代码>项目1和<编码>项目2进行检查。

When capturing the Checkin-event using a plugin for TFS 2010 and you loop thru all the CheckinNotification properties (notificationEventArgs as CheckinNotification) I get..... Changeset, Comment, ComputerName, NotificationInfo, Options, CheckinNote, PolicyOverrideInfo, ChangesetOwnerName, WorkspaceOwnerName, WorkspaceName, CheckinType, SubmittedItems, HasAllItems

所提交的项目是收集,只是收集的序号......

string myitem="";
CheckinNotification data = notificationEventArgs as CheckinNotification;
if (data != null)
{                  
Type type = data.GetType();
PropertyInfo[] myproperties = type.GetProperties();
if (property.Name == "SubmittedItems")
{
foreach (var checkin in data.SubmittedItems)
myitem = checkin.ToString(); 
}
}  
}

这将给你所有已核实的档案。 这只是部分法典,你需要从原产物中找到榜样。 题为“2010年土耳其劳动力调查”: 利用原始产品登记一项活动





相关问题
Why not use TFS as a build / CI solution?

Currently our build solution is set up using TFS + MS Build scripts. TFS is also being used as a CI server. I ve seen several posts on this site telling people about other CI solutions. Are there ...

Get files from TFS under Linux [closed]

is there a free (command line) tool for linux which with I can get all files from a TFS-Repository (no Check in / Check out required - only get actual version)?

upgrading tfs 2008 sp1 to use sql server 2008

I have an instance of tfs 2008 supported by sql server 2005. I want to change the sql server machine by doing a restore based move. I also want to change the version of sql server to 2008. I know ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

TFSReg in 2010 Beta 2?

does anybody know what is the equivalent of the TFSReg.exe command-line tool in 2010 Beta 2? I cannot find it anywhere, I searched the entire Program Files tree. Was it renamed? Moved? Replaced by ...

热门标签