Esempio n. 1
0
        private VssCredentials CreateCredentials(TfsConfiguration data)
        {
            if (data.AuthenticationType == AuthenticationType.Windows)
            {
                return(new VssCredentials());
            }

            var username = data.Username;
            var pw       = data.Password;

            return(new VssCredentials(new VssBasicCredential(username, pw)));
        }
Esempio n. 2
0
        internal VssConnection?CreateConnection(TfsConfiguration data)
        {
            var url = data.Url;

            if (string.IsNullOrWhiteSpace(url))
            {
                return(null);
            }

            if (_connections.TryGetValue(url, out var cachedConnection))
            {
                return(cachedConnection);
            }

            var credentials = CreateCredentials(data);

            var connection = new VssConnection(new Uri(url), credentials);

            _connections.Add(url, connection);

            return(connection);
        }