/// <summary> /// Connect to TFS /// </summary> private void Connect(ICredentials cred, bool anotherUser) { try { if (string.IsNullOrWhiteSpace(ConnectionUrl)) { MessageBox.Show(ResourceHelper.GetResourceString("MSG_CONNECTION_URL_IS_EMPTY"), ResourceHelper.GetResourceString("ERROR_TEXT"), MessageBoxButtons.OK, MessageBoxIcon.Error); } else { IsConnected = tfsManager.Connect(new Uri(ConnectionUrl), cred, anotherUser); AfterState(IsConnected); } } catch (UriFormatException ex) { MessageBox.Show(ResourceHelper.GetResourceString("MSG_CONNECTION_URL_IS_INCORRECT"), ResourceHelper.GetResourceString("ERROR_TEXT"), MessageBoxButtons.OK, MessageBoxIcon.Error); EventLog.WriteEntry("SalmaConnection", ex.Message, EventLogEntryType.Error); } }