コード例 #1
0
ファイル: RegexEditorForm.cs プロジェクト: gene71/RegexEditor
 /// <summary>
 /// Checks to make sure the scanner has at least one pattern and one
 /// file association before showing the save scanner form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         if (crs.Patterns.Count < 1)
         {
             MessageBox.Show("Scanner must contain at least one pattern", "Warning"
                             , MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         else if (crs.FileExtensions.Count < 1)
         {
             MessageBox.Show("Scanner must contain at least one file association", "Warning"
                             , MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         else
         {
             ScannerSaveForm ssf = new ScannerSaveForm(crs);
             ssf.Show();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error"
                         , MessageBoxButtons.OK, MessageBoxIcon.Error);
         crl.WriteLog(CRLogger.CRLogTitle.Error, ex.Message);
     }
 }
コード例 #2
0
ファイル: RegexEditorForm.cs プロジェクト: gene71/RegexEditor
        private void scannerToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            //init scanner object
            crs = null;
            crs = new CRScanner();
            //clear the patter combobox
            comboBox1.Items.Clear();
            //open scanner save form
            ScannerSaveForm ssf = new ScannerSaveForm(crs);

            ssf.Show();
        }