private bool ValidateInput() { if (String.IsNullOrEmpty(SourceTableName.Text)) { MessageBox.Show("A source table name is required", "Source Table Name Required", MessageBoxButton.OK, MessageBoxImage.Exclamation); return(false); } else if (String.IsNullOrEmpty(DestTableName.Text)) { MessageBox.Show("A destination table name is required", "Destination Table Name Required", MessageBoxButton.OK, MessageBoxImage.Exclamation); return(false); } string rules = "Table names must be valid DNS names, 3-63 characters in length, beginning with a letter and containing only alphanumeric characters. Table names are case-sensitive."; if (!StorageAccountViewModel.ValidTableName(SourceTableName.Text)) { MessageBox.Show("The source table name is invalid.\r\n\r\n" + rules, "Invalid Source Table Name", MessageBoxButton.OK, MessageBoxImage.Exclamation); return(false); } if (!StorageAccountViewModel.ValidTableName(DestTableName.Text)) { MessageBox.Show("The destination table name is invalid.\r\n\r\n" + rules, "Invalid Source Table Name", MessageBoxButton.OK, MessageBoxImage.Exclamation); return(false); } if (String.Compare(SourceTableName.Text, DestTableName.Text) == 0) { MessageBox.Show("The destination table name must be different from the original table name", "Destination Table Name Not Unique", MessageBoxButton.OK, MessageBoxImage.Exclamation); return(false); } return(true); }
private bool ValidateInput() { if (String.IsNullOrEmpty(TableName.Text)) { MessageBox.Show("A table name is required", "Table Name Required", MessageBoxButton.OK, MessageBoxImage.Exclamation); return(false); } if (!StorageAccountViewModel.ValidTableName(TableName.Text)) { MessageBox.Show("The table name is invalid.\r\n\r\nTable names must be valid DNS names, 3-63 characters in length, beginning with a letter and containing only alphanumeric characters. Table names are case-sensitive.", "Invalid Table Name", MessageBoxButton.OK, MessageBoxImage.Exclamation); return(false); } return(true); }