/// <summary> /// Generates a new connection to TFS and verifies the connection has been established. /// </summary> /// <param name="uri">TFS server URI</param> /// <param name="credentials">TFS server credentials</param> private static void EstablishTfsPersistentConnection(Uri uri, ICredentials credentials) { lock (SyncRoot) { try { var connection = new TfsTeamProjectCollection(uri, credentials); _instance = new TfsPersistentConnection(connection); _instance.TfsTeamProjectCollection.EnsureAuthenticated(); Sitecore.Diagnostics.Log.Info("[Rainbow.Tfs] TFS Persistent Connection: successfully established new connection with TFS server.", credentials); } catch (Exception ex) { Sitecore.Diagnostics.Log.Error("[Rainbow.Tfs] TFS Persistent Connection: could not establish connection with TFS server.", ex, credentials); throw; } } }
/// <summary> /// Generates a new connection to TFS and verifies the connection has been established. /// </summary> /// <param name="uri">TFS server URI</param> /// <param name="credentials">TFS server credentials</param> private static void EstablishTfsPersistentConnection(Uri uri, ICredentials credentials) { lock (SyncRoot) { try { var connection = new TfsTeamProjectCollection(uri, credentials); _instance = new TfsPersistentConnection(connection); _instance.TfsTeamProjectCollection.EnsureAuthenticated(); Sitecore.Diagnostics.Log.Info("[Rainbow.Tfs] TFS Persistent Connection: successfully established new connection with TFS server.", credentials); } catch (Exception ex) { Sitecore.Diagnostics.Log.Error("[Rainbow.Tfs] TFS Persistent Connection: could not establish connection with TFS server.", ex, credentials); throw; } } }