private void lbNewConnections_SelectionChanged(object sender, SelectionChangedEventArgs e) { base.Close(); SelectConnection.WindowOpen = true; AddNewServer addNewServer = new AddNewServer(); Application.ShowModalWindow(addNewServer); }
private string BuildServerName(string uriString) { string text = ""; if (Uri.IsWellFormedUriString(uriString, UriKind.Absolute)) { Uri uri = new Uri(uriString); text = this.ReplaceSpecialCharacters(uri.Host.Trim()); int num = 1; string text2 = text; while (AddNewServer.NameAlreadyExists(text2)) { text2 = text + num.ToString(); num++; } return(text2); } return(text); }
private bool NameIsValid(string proposedName) { proposedName = proposedName.Trim(); return(!string.IsNullOrEmpty(proposedName) && !AddNewServer.NameAlreadyExists(proposedName)); }