示例#1
0
 private void FormatB_Click(object sender, EventArgs e)
 {
     try
     {
         if (!isEng && !isRu)
         {
             MessageBox.Show("Set the language, please!");
             return;
         }
         if (MessageBox.Show("Continue?", "", MessageBoxButtons.YesNo).ToString() == "Yes")
         {
             this.Visible = false;
             if (fileW == null)
             {
                 fileW = new StreamWriter(fileOut.FileName);
             }
             FormatMachine a = new FormatMachine();
             a.Length = length;
             if (isEng)
             {
                 a.Consonants = enConsonants;
                 a.Vowels     = enVowels;
             }
             else
             {
                 a.Consonants = ruConsonants;
                 a.Vowels     = ruVowels;
             }
             a.FormatFromFile(fileR, fileW);
             fileR.Close();
             fileW.Close();
             if (MessageBox.Show(endFormat, "", MessageBoxButtons.YesNo).ToString() == "No")
             {
                 this.Close();
             }
             else
             {
                 end();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         end();
     }
 }
示例#2
0
 public rules(FormatMachine parent)
 {
     Parent = parent;
 }