示例#1
0
        private bool ValidateInput()
        {
            if (String.IsNullOrEmpty(SourceQueueName.Text))
            {
                MessageBox.Show("A source queue name is required", "Source Queue Name Required", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return(false);
            }
            else if (String.IsNullOrEmpty(DestQueueName.Text))
            {
                MessageBox.Show("A destination queue name is required", "Destination Queue Name Required", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return(false);
            }

            string rules = "Queue names must be 3-63 characters in length and may contain lower-case alphanumeric characters and dashes. Dashes must be preceded and followed by an alphanumeric character.";

            if (!StorageAccountViewModel.ValidQueueName(SourceQueueName.Text))
            {
                MessageBox.Show("The source queue name is invalid.\r\n\r\n" + rules, "Invalid Source Queue Name", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return(false);
            }

            if (!StorageAccountViewModel.ValidQueueName(DestQueueName.Text))
            {
                MessageBox.Show("The source queue name is invalid.\r\n\r\n" + rules, "Invalid Source Queue Name", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return(false);
            }

            if (String.Compare(SourceQueueName.Text, DestQueueName.Text) == 0)
            {
                MessageBox.Show("The destination queue name must be different from the original queue name", "Destination Table Name Not Unique", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return(false);
            }

            return(true);
        }
示例#2
0
        private bool ValidateInput()
        {
            if (String.IsNullOrEmpty(QueueName.Text))
            {
                MessageBox.Show("A queue name is required", "Queue Name Required", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return(false);
            }

            if (!StorageAccountViewModel.ValidQueueName(QueueName.Text))
            {
                MessageBox.Show("The queue name is invalid.\r\n\r\nQueue names must be 3-63 characters in length and may contain lower-case alphanumeric characters and dashes. Dashes must be preceded and followed by an alphanumeric character.", "Invalid Queue Name", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return(false);
            }

            return(true);
        }