Format:
Recent snippets for: Jim Lamb
using System; using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.WorkItemTracking.Client; class Program { /// <summary> /// Create a parent-child link between two work items in a TFS team project collection /// </summary> /// <param name="args"></param>
86 Views
no comments
<Import Project="$(MSBuildExtensionsPath32)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" /> <ItemGroup> <SourceFiles Include="$(SolutionDir)**/*.*" Exclude="$(SolutionDir)Package/**/*.*;$(SolutionDir)**/bin/**/*.*;$(SolutionDir)**/obj/**/*.*;$(SolutionDir)**/internal.proj;$(SolutionDir)**/*.*scc;$(SolutionDir)$(SolutionName).zip"> <Visible>False</Visible> </SourceFiles> </ItemGroup> <Target Name="AfterBuild" Condition="'$(Configuration)'=='Release'" Inputs="@(SourceFiles)" Outputs="$(SolutionDir)$(SolutionName).zip">
115 Views
no comments
using Microsoft.TeamFoundation.VersionControl.Client; using Microsoft.TeamFoundation.WorkItemTracking.Client; // create a new work item linked to an existing item in version control static void CreateLinkedWorkItem(String teamProject, String workItemType) { using (var tfs = TeamFoundationServerFactory.GetServer(_ServerUri)) { var workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
133 Views
no comments
using Microsoft.TeamFoundation.WorkItemTracking.Client; // populate a TreeView with the work item queries for a particular team project treeView.Nodes.Clear(); foreach (QueryItem queryItem in teamProject.QueryHierarchy) { GetNodesForQueryFolder(queryItem as QueryFolder, treeQueryView.Nodes); }
72 Views
no comments
using Microsoft.TeamFoundation.VersionControl.Client; // query the version control repository for items matching a file specification // set the folder for the root of your search String rootFolder = "$/MyProject"; // construct the set of item specifications you want to search for ItemSpec[] itemSpecs = new ItemSpec[] { new ItemSpec(String.Format("{0}/*.sln", rootFolder), RecursionType.Full), };
68 Views
no comments
using Microsoft.TeamFoundation.Build.Client; // enumerate the build controllers and agents for the specified project collection var tfs = TeamFoundationServerFactory.GetServer("http://tfserver:8080/tfs/DefaultCollection"); IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer)); var buildControllers = (IEnumerable<IBuildController>)buildServer.QueryBuildControllers(true); foreach (IBuildController controller in buildControllers) {
53 Views
no comments
using System.Net; using Microsoft.TeamFoundation; using Microsoft.TeamFoundation.Client; // Connect to a project collection by Uri try { Uri projectCollectionUri = new Uri("http://tfs2010:8080/tfs/MyCollection"); TeamFoundationServer tfs = new TeamFoundationServer(projectCollectionUri, new UICredentialsProvider()); tfs.EnsureAuthenticated();
81 Views
no comments
using Microsoft.TeamFoundation.Client; RegisteredProjectCollection[] collections = RegisteredInstances.GetProjectCollections(); if (collections != null) { foreach (RegisteredProjectCollection collection in collections) { Console.WriteLine(String.Format("{0} - {1}", collection.Name, collection.Uri)); }
55 Views
no comments
using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.Build.Client; namespace Microsoft.TeamFoundation.Sample { class Program { static void Main(string[] args) { // replace this string with the URI to your team project collection
57 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
