public void runVariableValidator(String str)
 {
     Responce resp = new Responce();
     validator = new Validator();
     resp = validator.validateNumber(str);
     if (resp.Error)
         Console.WriteLine("error: " + resp.Error + " in string: \"" + resp.Result + "\"");
     else
         Console.WriteLine("       " + resp.Error + " in string: \"" + resp.Result + "\" OK");
 }
 private void runValidator(String str)
 {
     validator = new Validator();
     ValidationResponce response = validator.validate(str);
     if (!response.Error)
     {
         Console.WriteLine("test#" + numberOfCalls + " " + str + " OK\n");
     }
     else
     {
         Console.WriteLine("test#" + numberOfCalls +
                             "\n     error: " + response.Error +
                             "(" + response.ErrorType + ")" +
                             " from: " + response.PositionBegin + ", to: " + response.PositionEnd +
                             "\n     in the string:\n     " + str + "\n");
     }
     ++numberOfCalls;
 }
예제 #3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            #region Init UI

            //Create textBox for VarList Component
            dynamicTextBox = new TextBox();

            // Add it to form
            this.Controls.Add(this.dynamicTextBox);

            //events
            dynamicTextBox.KeyPress += new KeyPressEventHandler(dynamicTextBox_KeyPress);
            dynamicTextBox.LostFocus += new EventHandler(dynamicTextBox_LostFocus);
            #endregion
            #region Init Logic
            //
            ProgCore = new Classes.ProgramCore();
            Validator = new Classes.Validator();
            #endregion
        }
 public ProgramCore()
 {
     ValidatorTool = new Validator();
     mainThread = new Thread(new ParameterizedThreadStart(Steps));
 }