Example #1
0
 private void StartButton_Click(object sender, EventArgs e)
 {
     if (!m_BackgroundThread.IsBusy)
     {
         if (!String.IsNullOrEmpty(CodeLocationTextBox.Text))
         {
             if (Directory.Exists(CodeLocationTextBox.Text))
             {
                 if (ChooseLangComboBox.SelectedIndex > -1)
                 {
                     if (!String.IsNullOrEmpty(ChoosenFilesExtensionsTextBox.Text))
                     {
                         ResetResults();
                         ShowResults();
                         ShowSyntacticInfo();
                         CancelOpButton.Enabled       = true;
                         StatusLabel.Text             = ICloneLocalization.CMNMESS_OperationInProgress;
                         m_Counter.LoadFilesProgress += new EventHandler(ReportProgress);
                         m_StopWatch.Start();
                         m_BackgroundThread.RunWorkerAsync();
                     }
                     else
                     {
                         ChoosenFilesExtensionsTextBox.Focus();
                         ChoosenFilesExtensionsTextBox_Validating(ChoosenFilesExtensionsTextBox, new CancelEventArgs());
                     }
                 }
                 else
                 {
                     ChooseLangComboBox.Focus();
                     ChooseLangComboBox_Validating(ChooseLangComboBox, new CancelEventArgs());
                 }
             }
             else
             {
                 CodeLocationTextBox.Focus();
                 CodeLocationTextBox_Validating(CodeLocationTextBox, new CancelEventArgs());
             }
         }
         else
         {
             CodeLocationTextBox.Focus();
             CodeLocationTextBox_Validating(CodeLocationTextBox, new CancelEventArgs());
         }
     }
 }
Example #2
0
        private bool Check()
        {
            bool result = false;

            if (!String.IsNullOrEmpty(CodeLocationTextBox.Text))
            {
                if (Directory.Exists(CodeLocationTextBox.Text))
                {
                    if (ChooseLangComboBox.SelectedIndex > INVALID_COMBOBOX_SelectedIndex)
                    {
                        if (!String.IsNullOrEmpty(ChoosenFilesExtensionsTextBox.Text))
                        {
                            if (CodeEncodingComboBox.SelectedIndex > INVALID_COMBOBOX_SelectedIndex)
                            {
                                result = true;
                            }
                            else
                            {
                                CodeEncodingComboBox.Focus();
                            }
                        }
                        else
                        {
                            ChoosenFilesExtensionsTextBox.Focus();
                            ChoosenFilesExtensionsTextBox_Validating(ChoosenFilesExtensionsTextBox, new CancelEventArgs());
                        }
                    }
                    else
                    {
                        ChooseLangComboBox.Focus();
                        ChooseLangComboBox_Validating(ChooseLangComboBox, new CancelEventArgs());
                    }
                }
                else
                {
                    SayCodeLocationTextBoxError();
                }
            }
            else
            {
                SayCodeLocationTextBoxError();
            }

            return(result);
        }