Get TFS Model and TFS Service Using TFS SDK

本文介绍了一种通过C#代码获取Team Foundation Server (TFS)各项服务的方法,包括工作项存储、版本控制服务、公共结构服务、组安全服务及构建服务等。文中提供了一个具体的类实现示例。

To get TFS Model/services, please add these assemblies to reference http://www.cnblogs.com/Ruiz/archive/2009/09/18/1569416.html 

Following code shows how to get the service

public   class  TFSModal
    {

        
// TFS Model 
         public  TeamFoundationServer TFServer {  get set ; }
        
// WorkItemStore 
         public  WorkItemStore WorkItemStore {  get set ; }
        
        
// Get Project Info 
         public  ICommonStructureService CommonStructureService {  get set ; }
        
// VersionControlServer 
         public  VersionControlServer VersionControlServer {  get set ; }
        
// User and Permission
         public  IGroupSecurityService GroupSecurityService {  get set ; }
        
// Build
         public  IBuildServer BuildServer {  get set ; }
        
        
public  TFSModal( string  serverName)
        {
            
try
            {

                TFServer 
=  TeamFoundationServerFactory.GetServer(serverName);
                WorkItemStore 
=  (WorkItemStore)TFServer.GetService( typeof (WorkItemStore));
                VersionControlServer 
=  (VersionControlServer)TFServer.GetService( typeof (VersionControlServer));
                CommonStructureService 
=  (ICommonStructureService)TFServer.GetService( typeof (ICommonStructureService));
                GroupSecurityService 
=  (IGroupSecurityService)TFServer.GetService( typeof (IGroupSecurityService));
                BuildServer 
=  (IBuildServer)TFServer.GetService( typeof (IBuildServer));
            }
            
catch  { }

           
        }
}

转载于:https://www.cnblogs.com/Ruiz/archive/2009/09/18/1569422.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值