Esempio n. 1
0
        static void Main(string[] args)
        {
            var url = new Uri("https://jacanotest123.visualstudio.com");

            var connection = new VssConnection(url, new VssClientCredentials());

            //var connection = new VssConnection(url, new VssBasicCredential("pat", "t77dabkbus5eu77bnvya6k4garoy3kxgyqn4jogktlmqslththea"));

            connection.ConnectAsync().SyncResult();

            TfvcHttpClient tfvcClient = connection.GetClient <TfvcHttpClient>();

            IEnumerable <TfvcBranch> branches = tfvcClient.GetBranchesAsync(includeParent: true, includeChildren: true).Result;
        }
Esempio n. 2
0
        public IEnumerable <TfvcBranch> ListBranches()
        {
            VssConnection  connection = this.Context.Connection;
            TfvcHttpClient tfvcClient = connection.GetClient <TfvcHttpClient>();

            IEnumerable <TfvcBranch> branches = tfvcClient.GetBranchesAsync(includeParent: true, includeChildren: true).Result;

            foreach (TfvcBranch branch in branches)
            {
                Console.WriteLine("{0} ({2}): {1}", branch.Path, branch.Description ?? "<no description>", branch.Owner.DisplayName);
            }

            if (branches.Count() == 0)
            {
                Console.WriteLine("No branches found.");
            }

            return(branches);
        }