コード例 #1
0
ファイル: MiddleLevelCode.cs プロジェクト: apetrovskiy/STUPS
        public static void StartProcessWithFormAndControl(
            UIAutomationTestForms.Forms formCode,
            TimeoutsAndDelays formDelayEn,
            System.Windows.Automation.ControlType controlType,
            string controlName,
            string controlAutomationId,
            TimeoutsAndDelays controlDelayEn)
        {
            var controlToForm = 
                new ControlToForm(
                    controlType,
                    controlName,
                    controlAutomationId, 
                    controlDelayEn);
            
            // 20150322
            /*
            var arr = new System.Collections.ArrayList();
            arr.Add(controlToForm);
            
            StartProcessWithFormAndControl(
                formCode,
                formDelayEn,
                ((ControlToForm[])arr.ToArray(typeof(ControlToForm))));
            */
            var arr = new ArrayList {controlToForm};

            StartProcessWithFormAndControl(
                formCode,
                formDelayEn,
                ((ControlToForm[])arr.ToArray(typeof(ControlToForm))));
        }
コード例 #2
0
ファイル: MiddleLevelCode.cs プロジェクト: apetrovskiy/STUPS
        public static void StartProcessWithForm(UIAutomationTestForms.Forms formCode,
                                                TimeoutsAndDelays formDelayEn)
        {
            var formDelay = (int)formDelayEn;
            TestProcessStartInfo.Arguments = ((int)formCode).ToString();
            TestProcessStartInfo.CreateNoWindow = true;
            TestProcessStartInfo.UseShellExecute = false;
            
            TestProcessStartInfo.Arguments += " ";
            TestProcessStartInfo.Arguments += formDelay.ToString();

            Console.WriteLine(
                TestFormPath +
                " " +
                TestProcessStartInfo.Arguments);
            TestProcess = Process.Start(TestProcessStartInfo);
        }
コード例 #3
0
ファイル: MiddleLevelCode.cs プロジェクト: krisdages/STUPS
        public static void StartProcessWithFormAndControl(
            UIAutomationTestForms.Forms formCode,
            TimeoutsAndDelays formDelayEn,
            object[] controlToForm)
        {
            int formDelay = (int)formDelayEn;

            ControlToForm[] controlToFormConverted =
                (ControlToForm[])controlToForm;

            TestProcessStartInfo.Arguments =
                ((int)formCode).ToString();
            TestProcessStartInfo.CreateNoWindow = true;
            TestProcessStartInfo.UseShellExecute = false;
            TestProcessStartInfo.LoadUserProfile = false;
            // form delay
            TestProcessStartInfo.Arguments += " ";
            TestProcessStartInfo.Arguments +=
                formDelay.ToString();

            if (controlToFormConverted.Length > 0) {
                for (int i = 0; i < controlToFormConverted.Length; i++) {

                    // control type
                    TestProcessStartInfo.Arguments += " ";
                    string _controlType =
                        controlToFormConverted[i].ControlType.ProgrammaticName.Substring(
                            controlToFormConverted[i].ControlType.ProgrammaticName.IndexOf(".") + 1);
                    TestProcessStartInfo.Arguments +=
                        _controlType;

                    // control delay
                    int controlDelay = (int)controlToFormConverted[i].ControlDelayEn;
                    TestProcessStartInfo.Arguments += " ";
                    TestProcessStartInfo.Arguments +=
                        controlDelay;
                        //controlToFormConverted[i].ControlDelayEn.ToString();

                    // control name
                    TestProcessStartInfo.Arguments += " ";
                    TestProcessStartInfo.Arguments +=
                        controlToFormConverted[i].ControlName;

                    // control AutomationId
                    TestProcessStartInfo.Arguments += " ";
                    TestProcessStartInfo.Arguments +=
                        controlToFormConverted[i].ControlAutomationId;
                }
            }

            Console.WriteLine(
                TestFormPath +
                " " +
                TestProcessStartInfo.Arguments);
            TestProcess =
                System.Diagnostics.Process.Start(TestProcessStartInfo);

            // System.Threading.Thread.Sleep(200); // just to check
        }
コード例 #4
0
ファイル: MiddleLevelCode.cs プロジェクト: apetrovskiy/STUPS
        public static void StartProcessWithFormAndControl(
            UIAutomationTestForms.Forms formCode,
            TimeoutsAndDelays formDelayEn,
            object[] controlToForm)
        {
            int formDelay = (int)formDelayEn;
            
            var controlToFormConverted = (ControlToForm[])controlToForm;
            
            TestProcessStartInfo.Arguments = ((int)formCode).ToString();
            TestProcessStartInfo.CreateNoWindow = true;
            TestProcessStartInfo.UseShellExecute = false;
            TestProcessStartInfo.LoadUserProfile = false;
            // form delay
            TestProcessStartInfo.Arguments += " ";
            TestProcessStartInfo.Arguments += formDelay.ToString();
            
            if (controlToFormConverted.Length > 0) {
                foreach (ControlToForm currentForm in controlToFormConverted)
                {
                    // control type
                    TestProcessStartInfo.Arguments += " ";
                    var controlType = 
                        currentForm.ControlType.ProgrammaticName.Substring(
                            currentForm.ControlType.ProgrammaticName.IndexOf(".") + 1);
                    TestProcessStartInfo.Arguments += controlType;
                    
                    // control delay
                    int controlDelay = (int)currentForm.ControlDelayEn;
                    TestProcessStartInfo.Arguments += " ";
                    TestProcessStartInfo.Arguments += controlDelay;
                    //controlToFormConverted[i].ControlDelayEn.ToString();
                    
                    // control name
                    TestProcessStartInfo.Arguments += " ";
                    TestProcessStartInfo.Arguments += currentForm.ControlName;
                    
                    // control AutomationId
                    TestProcessStartInfo.Arguments += " ";
                    TestProcessStartInfo.Arguments += currentForm.ControlAutomationId;
                }
            }

            Console.WriteLine(
                TestFormPath +
                " " +
                TestProcessStartInfo.Arguments);
            TestProcess = Process.Start(TestProcessStartInfo);
        }