Пример #1
0
        public static void CheckVipr()
        {
            ViPrThread CheckViPrRunning       = new ViPrThread();
            Thread     CheckViPrRunningThread = new Thread(CheckViPrRunning.CheckViPrRunning);

            CheckViPrRunningThread.Start();

            CheckViPrRunningThread.Join(60000);

            bool MainMenuFound = false;

            for (var i = 0; i < 100; i++)
            {
                Console.WriteLine("Try block inside cycle");
                var allItems = Desktop.Instance.GetMultiple(SearchCriteria.All);

                foreach (var item in allItems)
                {
                    if (item.Name.Contains("ViPr - [Main Menu]"))
                    {
                        Console.WriteLine("Item Name: " + item.Name);
                        Console.WriteLine("ViPr Main Menu Found");
                        MainMenuFound = true;
                        break;
                    }
                }
                if (MainMenuFound)
                {
                    //ViPrObjectThread.Abort();
                    break;
                }
                else
                {
                    Thread.Sleep(2000);
                }
            }

            if (!MainMenuFound)
            {
                Console.WriteLine("ViPr Main Menu NOT Found");
                CheckViPrRunning.DoEmergencyExit();
                CheckViPrRunningThread.Join();
            }

            //ExecuteCommandCmd("\"c:\\Program Files\\ViPr\\ViPr.exe\"");
            //Thread.Sleep(30000);
        }
Пример #2
0
 public void DoAtStart()
 {
     Console.WriteLine("Enter in RunViPr Thread");
     ViPrThread.RunVipr();
     ViPrThread.LogOnToSystem(NunitSettings.OperatorId, NunitSettings.PasswordId, NunitSettings.PaymentId, NunitSettings.PasswordPay, NunitSettings.ResearchId, NunitSettings.PasswordRes);
 }