예제 #1
0
        public static void AddInspectUi(RecordedUiTask uiTask)
        {
            s_inspectUi = null;
            lock (RecordedUiTask.s_lockRecordedUi)
            {
                foreach (var recordedUi in RecordedUiTask.s_listRecordedUi)
                {
                    if (recordedUi.UiTaskName == EnumUiTaskName.Inspect)
                    {
                        s_inspectUi = recordedUi;
                        break;
                    }
                }

                if (uiTask != null)
                {
                    RecordedUiTask.s_listRecordedUi.Add(uiTask);

                    if (uiTask.UiTaskName != EnumUiTaskName.KeyboardInput)
                    {
                        UiTreeNode.AddToUiTree(uiTask);
                    }
                }
            }

            NativeMethods.PostMessage(MainWindow.s_windowHandle, (int)UiThreadTask.RemoveInspectNode, 0, 0);
            NativeMethods.PostMessage(MainWindow.s_windowHandle, (int)UiThreadTask.UpdateTreeView, 0, 0);
            if (uiTask != null)
            {
                NativeMethods.PostMessage(MainWindow.s_windowHandle, (int)UiThreadTask.XPathReady, 0, 0);
            }
        }
예제 #2
0
        public static void AddRecordedUi(RecordedUiTask uiTask)
        {
            lock (RecordedUiTask.s_lockRecordedUi)
            {
                RecordedUiTask.s_listRecordedUi.Add(uiTask);

                if (uiTask.UiTaskName != EnumUiTaskName.KeyboardInput)
                {
                    UiTreeNode.AddToUiTree(uiTask);
                }
            }

            NativeMethods.PostMessage(MainWindow.s_windowHandle, (int)UiThreadTask.UpdateTreeView, 0, 0);
        }