祥叔学编程

祥叔学编程
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2014年3月15日

摘要: TFS二次开发11——标签(Label)TFS二次开发10——分组(Group)和成员(Member)TFS二次开发09——查看文件历史(QueryHistory)TFS二次开发08——分支(Branch)和合并(Merge)TFS二次开发07——锁定(Lock)和解锁(UnLock)TFS二次开发06——签入(CheckIn)TFS二次开发05——下载文件(DownloadFile)TFS二次开发04——工作区(Workspace)和映射(Mapping)TFS二次开发03——ItemTFS二次开发02——连接TFSTFS二次开发01——TeamProjectsPicher 阅读全文

posted @ 2014-03-15 18:40 祥叔 阅读(1213) 评论(0) 推荐(2) 编辑

摘要: 下图是在VS2010里创建Label的界面可以看出创建Label 需要如下参数:Name、Comment、Path、Version 。下面是代码实现:using Microsoft.TeamFoundation.Client;using Microsoft.TeamFoundation.VersionControl.Client;string tpcURL = "http://127.0.0.1:8080/";TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(tpcURL));Versio 阅读全文

posted @ 2014-03-15 17:28 祥叔 阅读(1540) 评论(0) 推荐(0) 编辑

摘要: TFS SDK 10 ——分组(Group)和成员(Member)这篇来介绍怎样读取TFS服务器上的用户信息 首先TFS默认有如下分组(Group):SharePoint Web Application ServicesTeam Foundation AdministratorsTeam Foundation Proxy Service AccountsTeam Foundation Service AccountsTeam Foundation Valid UsersWork Item Only View Users其中Team Foundation Valid Users 包含其他所有分. 阅读全文

posted @ 2014-03-15 17:27 祥叔 阅读(1391) 评论(0) 推荐(0) 编辑

摘要: 这篇文章给大家展示怎样获取一个文件的历史版本,内容很简单,直接上代码了。string tpcURL = "http://127.0.0.1:8080/";TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(newUri(tpcURL));VersionControlServer version = tpc.GetService(typeof(VersionControlServer)) as VersionControlServer;string serverDir = "$/MySolution 阅读全文

posted @ 2014-03-15 17:26 祥叔 阅读(1598) 评论(0) 推荐(0) 编辑

摘要: 一:创建分支private static void BranchFile(Workspace workspace, String newFilename){ String branchedFilename = Path.Combine(Path.GetDirectoryName(newFilename), Path.GetFileNameWithoutExtension(newFilename)) + "-branch" + Path.GetExtension(newFilename); workspace.PendBranch(newFilename, branchedF 阅读全文

posted @ 2014-03-15 17:24 祥叔 阅读(2606) 评论(0) 推荐(0) 编辑

摘要: 一:锁定(Lock)string tpcURL = "http://192.168.83.62:8080/";TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(tpcURL));VersionControlServer version = tpc.GetService(typeof(VersionControlServer)) as VersionControlServer;version.NonFatalError += version_NonFatalError;Workspace[] 阅读全文

posted @ 2014-03-15 17:22 祥叔 阅读(1502) 评论(0) 推荐(0) 编辑

摘要: 一个Item 就是一个文件或文件夹using Microsoft.TeamFoundation.Client;using Microsoft.TeamFoundation.VersionControl.Client;一:添加Item//连接到TFS服务器string tpcURL = "http://127.0.0.1:8080/tfs/";TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(tpcURL));VersionControlServer version = tpc.GetSer 阅读全文

posted @ 2014-03-15 17:20 祥叔 阅读(1873) 评论(1) 推荐(0) 编辑

摘要: 前面介绍了怎样读取TFS上目录和文件的信息,怎么建立服务器和本地的映射(Mapping)。本节介绍怎样把TFS服务器上的文件下载到本地。下载文件可以有两种方式:using Microsoft.TeamFoundation.VersionControl.Client;using Microsoft.TeamFoundation.Client;方式一:使用VersionControlServer对象,如:string tpcURL = "http://192.168.83.62:8080";TfsTeamProjectCollection tpc = new TfsTeamPr 阅读全文

posted @ 2014-03-15 17:19 祥叔 阅读(2241) 评论(0) 推荐(0) 编辑

摘要: 在前面几节介绍了怎样读取TFS服务器上的项目以及文件的信息,这一节将介绍怎么建立服务器和本地的映射(Mapping)。引用命名空间usingMicrosoft.TeamFoundation.Client;usingMicrosoft.TeamFoundation.VersionControl.Client;一:Workspace 工作区 是服务器的文件、目录在客户端的映像。当用户对源代码管理中的目标进行增加、编辑、删除、移动、重命名,或者其他操作时,用户的修改会保留在工作空间中,标记为工作空间中的“待定/未提交修改”(Pending Change)。这些修改只有被用户签入(Check In)后 阅读全文

posted @ 2014-03-15 17:18 祥叔 阅读(2260) 评论(0) 推荐(0) 编辑

摘要: 在TFS 中把每个文件夹被抽象成“ItemSet”或“Item”,相对于父级目录来讲就是Item ,相对于子级目录来讲就是“ItemSet”。每个文件都被抽象成“Item”。//连接TFSstring tpcURL = "http://192.168.83.62:8080";TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(tpcURL));VersionControlServer version = tpc.GetService(typeof(VersionControlServer)) 阅读全文

posted @ 2014-03-15 17:12 祥叔 阅读(1032) 评论(0) 推荐(0) 编辑

摘要: 在上一篇《TFS二次开发01——TeamProjectsPicher》介绍了 TeamProjectsPicher 对象,使用该对象可以很简单的实现连接TFS。但是如果我们要实现自定义的UI客户端 或者我们要做一个非WinForm版的TFS客户端(比如Web 或者WPF),那么TeamProjectsPicher 对象就无能为力了。那我们就只能自己实现了。这篇文章主要介绍:1:连接TFS Server2:获取所有TfsTeamProjectCollection3:获取某个TfsTeamProjectCollection 下的所有Team Project添加命名空间using Microsoft 阅读全文

posted @ 2014-03-15 17:12 祥叔 阅读(2280) 评论(0) 推荐(1) 编辑

摘要: 作为TFS的二次开发,首先要做的第一件工作是怎样连接到TFS并选择我们要下载的项目。 本文就此介绍一下使用TeamProjectsPicher 连接到TFS服务器。添加引用 Microsoft.TeamFoundation和Microsoft.TeamFoundation.Client添加命名空间using Microsoft.TeamFoundation.Client;using Microsoft.TeamFoundation.Server;代码如下:TeamProjectPicker tpp = new TeamProjectPicker(TeamProjectPickerMode.Mu 阅读全文

posted @ 2014-03-15 17:02 祥叔 阅读(1539) 评论(0) 推荐(0) 编辑