コード例 #1
0
        private void lbNewConnections_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            base.Close();
            SelectConnection.WindowOpen = true;
            AddNewServer addNewServer = new AddNewServer();

            Application.ShowModalWindow(addNewServer);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 private bool NameIsValid(string proposedName)
 {
     proposedName = proposedName.Trim();
     return(!string.IsNullOrEmpty(proposedName) && !AddNewServer.NameAlreadyExists(proposedName));
 }