예제 #1
0
        private static bool CheckTfsServerPath(string path, NetworkCredential credential)
        {
            TfsConfigurationServer tfsServer = null;

            try
            {
                tfsServer = new TfsConfigurationServer(new Uri(path), credential);
                tfsServer.Connect(ConnectOptions.None);
                return(true);
            }
            catch
            {
                if (tfsServer != null)
                {
                    tfsServer.Dispose();
                }
            }

            return(false);
        }
예제 #2
0
        static void Main(string[] args)
        {
            var url = args?.FirstOrDefault();

            if (string.IsNullOrEmpty(url))
            {
                Log("You must send Url as arg.", ConsoleColor.Red);
                Log("Press key to exit.", ConsoleColor.White);
                Console.ReadKey();
                return;
            }

            _server = TfsConfigurationServerFactory.GetConfigurationServer(new Uri(url));
            _server.Connect(ConnectOptions.IncludeServices);

            Log($"Connected to {url}", ConsoleColor.Green);

            _server.GetAuthenticatedIdentity(out var identity);

            Log($"Connected identity is {identity.DisplayName} : {identity.UniqueName}", ConsoleColor.White);

            Init(args);
        }
        private static bool CheckTfsServerPath(string path, NetworkCredential credential)
        {
            TfsConfigurationServer tfsServer = null;
            try
            {
                tfsServer = new TfsConfigurationServer(new Uri(path), credential);
                tfsServer.Connect(ConnectOptions.None);
                return true;
            }
            catch
            {
                if (tfsServer != null)
                    tfsServer.Dispose();
            }

            return false;
        }