Esempio n. 1
0
        private void OkButton_Click(object sender, RoutedEventArgs e)
        {
            //không check thì không thực hiện
            if (!RadioButton1.IsChecked.Value && !RadioButton2.IsChecked.Value)
            {
                MessageBox.Show("Chưa chọn yêu cầu");
                this.DialogResult = true;
                this.Close();
                return;
            }
            int len;

            if (!int.TryParse(LengthISBN.Text.ToString(), out len) || len <= 0)
            {
                MessageBox.Show("Độ dài ISBN không hợp lệ");
                this.DialogResult = true;
                this.Close();
                return;
            }
            if (AddMethodEvent != null)
            {
                string[] parameters = { LengthISBN.Text, RadioButton1.IsChecked.ToString(), RadioButton2.IsChecked.ToString() };
                AddMethodEvent.Invoke("Move", parameters);
            }
            this.DialogResult = true;
            this.Close();
        }
 private void OkButton_Click(object sender, RoutedEventArgs e)
 {
     foreach (char item in "\\/:*?\"<>|")
     {
         if (NewString.Text.Contains(item))
         {
             MessageBox.Show("Từ thay thế có chứa kí tự không hợp lệ");
             this.DialogResult = true;
             this.Close();
             return;
         }
     }
     if (OldString.Text == "")
     {
         MessageBox.Show("Từ thay thế chưa được điền");
         this.DialogResult = true;
         this.Close();
         return;
     }
     if (AddMethodEvent != null)
     {
         string[] parameters = { OldString.Text, NewString.Text };
         AddMethodEvent.Invoke("Replace", parameters);
     }
     this.DialogResult = true;
     this.Close();
 }
 private void OkButton_Click(object sender, RoutedEventArgs e)
 {
     //không check thì không thực hiện
     if (!CheckBox1.IsChecked.Value && !CheckBox2.IsChecked.Value && !CheckBox3.IsChecked.Value)
     {
         MessageBox.Show("Chưa chọn yêu cầu");
         this.DialogResult = true;
         this.Close();
         return;
     }
     if (AddMethodEvent != null)
     {
         string[] parameters = { CheckBox1.IsChecked.ToString(), CheckBox2.IsChecked.ToString(), CheckBox3.IsChecked.ToString() };
         AddMethodEvent.Invoke("FullnameNormalize", parameters);
     }
     this.DialogResult = true;
     this.Close();
 }