Exemplo n.º 1
0
 private void InputKey(Keyboard.Key key)
 {
     if (key == Keyboard.Key.BackSpace && text.DisplayedString.Length > 0)
     {
         text.DisplayedString = text.DisplayedString.Substring(0, text.DisplayedString.Length - 1);
         return;
     }
     if (key == Keyboard.Key.Enter)
     {
         InputInformation = false;
         EndWrite?.Invoke(this);
         return;
     }
     if (key != Keyboard.Key.BackSpace && text.DisplayedString.Length <= maxLenght)
     {
         text.DisplayedString += key.ToString();
     }
 }
Exemplo n.º 2
0
    public static void Main(string[] args)
    {
        EndWrite objTest = new EndWrite();

        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(objTest.AppDomainUnhandledException_EventHandler);

        Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);

        try
        {
            objTest.RunTest();
        }
        catch (Exception e)
        {
            Console.WriteLine(s_strTFAbbrev + " : FAIL The following exception was thorwn in RunTest(): \n" + e.ToString());
            objTest._numErrors++;
            objTest._exitValue = TCSupport.FailExitCode;
        }

        ////	Finish Diagnostics
        if (objTest._numErrors == 0)
        {
            Console.WriteLine("PASS.	 "+ s_strTFPath + " " + s_strTFName + " ,numTestcases==" + objTest._numTestcases);
        }
        else
        {
            Console.WriteLine("FAIL!	 "+ s_strTFPath + " " + s_strTFName + " ,numErrors==" + objTest._numErrors);

            if (TCSupport.PassExitCode == objTest._exitValue)
            {
                objTest._exitValue = TCSupport.FailExitCode;
            }
        }

        Environment.ExitCode = objTest._exitValue;
    }
Exemplo n.º 3
0
 protected virtual void OnEndWrite(FileReadWriteEventArgs e) // Инициализатор события EndWrite.
 {
     EndWrite?.Invoke(this, e);
 }