Exemplo n.º 1
1
 public ViewTree(IUIAutomationElement element, IUIAutomation automation)
 {
     this.root = new TreeNode(element);
     this.root.parent = null;
     IUIAutomationElementArray array = element.FindAll(TreeScope.TreeScope_Children, automation.CreateTrueCondition());
     if (0 == array.Length)
     {
         this.root.children = null;
         this.root.isLeaf = true;
     }
     else
     {
         for (int i = 0; i < array.Length; i++)
         {
             IUIAutomationElement e = array.GetElement(i);
             TreeNode n = new TreeNode(e);
             this.root.children.Add(n);
         }
     }
 }
        public void MyTestInitialize()
        {
            // Create the factory and register schemas
            _nFactory = new CUIAutomationClass();

            // Start the app
            var curDir = Environment.CurrentDirectory;
            _app = new TargetApp(curDir + "\\WpfAppWithAdvTextControl.exe");
            _app.Start();

            // Find the main control
            var appElement = _nFactory.ElementFromHandle(_app.MainWindow);

            var advTestBoxCondition = _nFactory.CreatePropertyCondition(UIA_PropertyIds.UIA_AutomationIdPropertyId, "advTextBox1");
            _nAdvancedTextBoxElement = appElement.FindFirst(NTreeScope.TreeScope_Children, advTestBoxCondition);
            Assert.IsNotNull(_nAdvancedTextBoxElement);

            var testControlCondition = _nFactory.CreatePropertyCondition(UIA_PropertyIds.UIA_AutomationIdPropertyId, "testControl");
            _nTestControlElement = appElement.FindFirst(NTreeScope.TreeScope_Children, testControlCondition);
            Assert.IsNotNull(_nTestControlElement);

            var window = AutomationElement.RootElement.FindFirst(WTreeScope.Children, new PropertyCondition(AutomationElement.NameProperty, "MainWindow"));
            _wAdvancedTextBoxElement = window.FindFirst(WTreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty, "advTextBox1"));
            _wTestControlElement = window.FindFirst(WTreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty, "testControl"));
        }
        /// <summary>
        /// Build a cacherequest for properties and patterns
        /// </summary>
        /// <param name="uia"></param>
        /// <param name="pps">Property ids</param>
        /// <param name="pts">Pattern ids</param>
        /// <returns></returns>
        public static IUIAutomationCacheRequest GetPropertiesCache(IUIAutomation uia, List <int> pps, List <int> pts)
        {
            if (uia == null)
            {
                throw new ArgumentNullException(nameof(uia));
            }

            var cr = uia.CreateCacheRequest();

            if (pps != null)
            {
                foreach (var pp in pps)
                {
                    cr.AddProperty(pp);
                }
            }

            if (pts != null)
            {
                foreach (var pt in pts)
                {
                    if (pt != 0)
                    {
                        cr.AddPattern(pt);
                    }
                }
            }

            return(cr);
        }
        public static bool CollapseAll(this IUIAutomationElement element, IUIAutomation automation)
        {
            if (element.CurrentIsOffscreen != 0)
            {
                return(false);
            }
            var returnValue = false;
            var condition   = automation.CreatePropertyCondition(UIA_PropertyIds.UIA_IsEnabledPropertyId, true);
            var item        = element.FindAll(TreeScope.TreeScope_Children, condition);

            for (var i = 0; i < item.Length; i++)
            {
                if (CollapseAll(item.GetElement(i), automation))
                {
                    returnValue = true;
                }
            }

            if (!(element.GetCurrentPattern(UIA_PatternIds.UIA_ExpandCollapsePatternId) is IUIAutomationExpandCollapsePattern
                  expandCollapsePattern) || expandCollapsePattern.CurrentExpandCollapseState ==
                ExpandCollapseState.ExpandCollapseState_LeafNode)
            {
                return(returnValue);
            }
            expandCollapsePattern.Collapse();
            return(true);
        }
Exemplo n.º 5
0
        private void ThreadProc()
        {
            // *** Note: The thread on which the UIA calls are made below must be MTA.
            automation = new CUIAutomation();

            autoEventInit.Set();


            bool closeDown = false;

            while (!closeDown)
            {
                // Wait here until we're told we have some work to do.
                autoEventMsg.WaitOne();

                while (true)
                {
                    EventMsgData msgData;

                    // Note that none of the queue or message related action here is specific to UIA.
                    // Rather it is only a means for the main UI thread and the background MTA thread
                    // to communicate.

                    // Get a message from the queue of action-related messages.
                    Monitor.Enter(msgQueue);
                    try
                    {
                        // An exception is thrown when the queue is empty.
                        msgData = msgQueue.Dequeue();
                    }
                    catch (InvalidOperationException)
                    {
                        // InvalidOperationException is thrown if the queue is empty.
                        msgData.msgType  = EventMsgType.msgNull;
                        msgData.element  = null;
                        msgData.useCache = false;

                        break;
                    }
                    finally
                    {
                        // Ensure that the lock is released.
                        Monitor.Exit(msgQueue);
                    }

                    if (msgData.msgType == EventMsgType.msgMessageBulidList)
                    {
                        // We will be here following a press of the Refresh button by the user.
                        BuildListOfMsgFromWindowInternal(false, false);
                    }
                    else if (msgData.msgType == EventMsgType.msgCloseDown)
                    {
                        //메인쓰레드 에서 메세지 후킹 쓰레드 종료 Msg 처리.
                        closeDown = true;

                        break;
                    }
                }
            }
        }
Exemplo n.º 6
0
 public Window(IntPtr handle, IUIAutomation uiAutomation, IKeyboard keyboard, IWinUserWrap winUserWrap)
 {
     this.Handle = handle;
     this.uiAutomation = uiAutomation;
     this.keyboard = keyboard;
     this.winUserWrap = winUserWrap;
 }
Exemplo n.º 7
0
        public void MyTestInitialize()
        {
            // Create the factory and register schemas
            _nFactory = new CUIAutomationClass();

            // Start the app
            var curDir = Environment.CurrentDirectory;

            _app = new TargetApp(curDir + "\\WpfAppWithAdvTextControl.exe");
            _app.Start();

            // Find the main control
            var appElement = _nFactory.ElementFromHandle(_app.MainWindow);

            var advTestBoxCondition = _nFactory.CreatePropertyCondition(UIA_PropertyIds.UIA_AutomationIdPropertyId, "advTextBox1");

            _nAdvancedTextBoxElement = appElement.FindFirst(NTreeScope.TreeScope_Children, advTestBoxCondition);
            Assert.IsNotNull(_nAdvancedTextBoxElement);

            var testControlCondition = _nFactory.CreatePropertyCondition(UIA_PropertyIds.UIA_AutomationIdPropertyId, "testControl");

            _nTestControlElement = appElement.FindFirst(NTreeScope.TreeScope_Children, testControlCondition);
            Assert.IsNotNull(_nTestControlElement);

            var window = AutomationElement.RootElement.FindFirst(WTreeScope.Children, new PropertyCondition(AutomationElement.NameProperty, "MainWindow"));

            _wAdvancedTextBoxElement = window.FindFirst(WTreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty, "advTextBox1"));
            _wTestControlElement     = window.FindFirst(WTreeScope.Descendants, new PropertyCondition(AutomationElement.AutomationIdProperty, "testControl"));
        }
Exemplo n.º 8
0
 public Window(IntPtr handle, IUIAutomation uiAutomation, IKeyboard keyboard, IWinUserWrap winUserWrap)
 {
     this.Handle       = handle;
     this.uiAutomation = uiAutomation;
     this.keyboard     = keyboard;
     this.winUserWrap  = winUserWrap;
 }
Exemplo n.º 9
0
 public void Uninitialize()
 {
     if (_automation != null)
     {
         _automation = null;
     }
 }
        static AutomationManager()
        {
            BandObjectLib.Logging.Add_DEBUG("Constructor.log", "AutomationManager");
            Guid   rclsid = CLSID_CUIAutomation;
            Guid   riid   = IID_IUIAutomation;
            object obj;

            PInvoke.CoCreateInstance(ref rclsid, IntPtr.Zero, 1, ref riid, out obj);
            pAutomation = obj as IUIAutomation;
            Thread automationThread = new Thread(Dispatcher.Run)
            {
                IsBackground = true
            };

            automationThread.Start();
            while (true)
            {
                automationDispatch = Dispatcher.FromThread(automationThread);
                if (automationDispatch != null)
                {
                    break;
                }
                Thread.Sleep(50);
            }
        }
        public static bool ExpandAll(this IUIAutomationElement element, IUIAutomation automation, int level)
        {
            if (element.CurrentIsOffscreen != 0)
            {
                return(false);
            }
            var returnValue = false;

            if (element.GetCurrentPattern(UIA_PatternIds.UIA_ExpandCollapsePatternId) is IUIAutomationExpandCollapsePattern expandCollapsePattern &&
                expandCollapsePattern.CurrentExpandCollapseState != ExpandCollapseState.ExpandCollapseState_LeafNode)
            {
                returnValue = true;
                // TODO: find timing issue and resolve structurally. This issue shows with CalcVolume
                Thread.Sleep(100);
                expandCollapsePattern.Expand();
            }

            var condition = automation.CreatePropertyCondition(UIA_PropertyIds.UIA_IsEnabledPropertyId, true);
            var item      = element.FindAll(TreeScope.TreeScope_Children, condition);

            for (var i = 0; i < item.Length; i++)
            {
                if (ExpandAll(item.GetElement(i), automation, level + 1))
                {
                    returnValue = true;
                }
            }

            return(returnValue);
        }
Exemplo n.º 12
0
 static void Uninitialize()
 {
     if (pAutomation != null)
     {
         Marshal.ReleaseComObject(pAutomation);
         pAutomation = null;
     }
 }
Exemplo n.º 13
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (_automation != null)
     {
         _automation = null;
     }
     timer1.Stop();
 }
 public FindElementHandler(
     IUIAutomation uiAutomation, IOverlay overlay, IElementFactory elementFactory,
     IElementSearcher searcher)
 {
     this.uiAutomation = uiAutomation;
     this.overlay = overlay;
     this.elementFactory = elementFactory;
     this.searcher = searcher;
 }
Exemplo n.º 15
0
 public void Dispose()
 {
     if (pAutomation != null)
     {
         Marshal.ReleaseComObject(pAutomation);
         pAutomation = null;
     }
     GC.SuppressFinalize(this);
 }
Exemplo n.º 16
0
        private bool allowed; // true = Yes, false = No

        public UACPromptHandler(IUIAutomation uiAutomation, IKeyboard keyboard)
        {
            this.uiAutomation = uiAutomation;
            this.keyboard     = keyboard;
            this.threadLazy   = null;
            this.stopped      = false;
            this.alive        = false;
            this.allowed      = false;
        }
Exemplo n.º 17
0
 public FindElementHandler(
     IUIAutomation uiAutomation, IOverlay overlay, IElementFactory elementFactory,
     IElementSearcher searcher)
 {
     this.uiAutomation   = uiAutomation;
     this.overlay        = overlay;
     this.elementFactory = elementFactory;
     this.searcher       = searcher;
 }
 public override void Init()
 {
     IUIAutomation uia = this.IUIAutomation;
     if (uia != null)
     {
         uia.AddAutomationEventHandler(this.EventId, this.Element, this.Scope, null, this);
         this.IsHooked = true;
     }
 }
 public UACPromptHandler(IUIAutomation uiAutomation, IKeyboard keyboard)
 {
     this.uiAutomation = uiAutomation;
     this.keyboard = keyboard;
     this.threadLazy = null;
     this.stopped = false;
     this.alive = false;
     this.allowed = false;
 }
Exemplo n.º 20
0
        public AutomationManager()
        {
            Guid   rclsid = CLSID_CUIAutomation;
            Guid   riid   = IID_IUIAutomation;
            object obj;

            PInvoke.CoCreateInstance(ref rclsid, IntPtr.Zero, 1, ref riid, out obj);
            pAutomation = obj as IUIAutomation;
            automationThread.Start(this);
        }
        public override void Init()
        {
            IUIAutomation uia = this.IUIAutomation;

            if (uia != null)
            {
                uia.AddPropertyChangedEventHandler(this.Element, this.Scope, null, this, this.propertyArray);
                this.IsHooked = true;
            }
        }
Exemplo n.º 22
0
 public ClickDetector(ClickStatus status, CursorCapture capture, CustomizationParameters parameters, MainForm form)
 {
     this.status = status;
     this.capture = capture;
     this.parameters = parameters;
     this.form = form;
     this.lastClick = new cursorInTime(-50, -50, null);
     InitTimer();
     this.automator = new CUIAutomation();
 }
Exemplo n.º 23
0
 public ClickDetector(ClickStatus status, CursorCapture capture, CustomizationParameters parameters, MainForm form)
 {
     this.status     = status;
     this.capture    = capture;
     this.parameters = parameters;
     this.form       = form;
     this.lastClick  = new cursorInTime(-50, -50, null);
     InitTimer();
     this.automator      = new CUIAutomation();
     this.lastSentToBack = 0;
 }
Exemplo n.º 24
0
        public FocusChangedEventListener(IUIAutomation uia, HandleUIAutomationEventMessage peDelegate)
        {
            if (uia == null)
            {
                throw new ArgumentNullException(nameof(uia));
            }

            this.UIAutomation       = uia;
            this.ListenEventMessage = peDelegate;
            this.UIAutomation.AddFocusChangedEventHandler(null, this);
            IsHooked = true;
        }
Exemplo n.º 25
0
        public override IUIAutomationElement GetUIAutomationElement(IUIAutomation automation)
        {
            var listElement = _listElement.GetUIAutomationElement(automation);

            var listItems = listElement.FindAll(
                interop.UIAutomationCore.TreeScope.TreeScope_Descendants,
                automation.CreatePropertyCondition(
                    UIA_PropertyIds.UIA_ControlTypePropertyId,
                    UIA_ControlTypeIds.UIA_ListItemControlTypeId));

            return listItems.GetElement(_index);
        }
Exemplo n.º 26
0
        public override IUIAutomationElement GetUIAutomationElement(IUIAutomation automation)
        {
            var listElement = _listElement.GetUIAutomationElement(automation);

            var listItems = listElement.FindAll(
                interop.UIAutomationCore.TreeScope.TreeScope_Descendants,
                automation.CreatePropertyCondition(
                    UIA_PropertyIds.UIA_ControlTypePropertyId,
                    UIA_ControlTypeIds.UIA_ListItemControlTypeId));

            return(listItems.GetElement(_index));
        }
Exemplo n.º 27
0
        public AutomationManager()
        {
            Guid   rclsid = CLSID_CUIAutomation;
            Guid   riid   = IID_IUIAutomation;
            object obj    = null;

            PInvoke.CoCreateInstance(ref rclsid, IntPtr.Zero, 1, ref riid, out obj);
            if (obj == null)
            {
                return;
            }
            pAutomation = obj as IUIAutomation;
        }
Exemplo n.º 28
0
        static AutomationElement()
        {
            Guid   rclsid = CLSID_CUIAutomation;
            Guid   riid   = IID_IUIAutomation;
            object obj    = null;

            PInvoke.CoCreateInstance(ref rclsid, IntPtr.Zero, 1, ref riid, out obj);
            if (obj == null)
            {
                return;
            }
            pAutomation = obj as IUIAutomation;

            rclsid = CLSID_CUIAutomationRegistrar;
            riid   = IID_IUIAutomationRegistrar;
            PInvoke.CoCreateInstance(ref rclsid, IntPtr.Zero, 1, ref riid, out obj);
            IUIAutomationRegistrar pRegistrar = obj as IUIAutomationRegistrar;

            try {
                UIAutomationPropertyInfo propinfo;
                propinfo = new UIAutomationPropertyInfo {
                    guid = ItemCount_Property_GUID,
                    pProgrammaticName = "ItemCount",
                    type = UIAutomationType_Int
                };
                pRegistrar.RegisterProperty(propinfo, out UIA_ItemCountPropertyId);
                propinfo = new UIAutomationPropertyInfo {
                    guid = SelectedItemCount_Property_GUID,
                    pProgrammaticName = "SelectedItemCount",
                    type = UIAutomationType_Int
                };
                pRegistrar.RegisterProperty(propinfo, out UIA_SelectedCountPropertyId);
                propinfo = new UIAutomationPropertyInfo {
                    guid = ItemIndex_Property_GUID,
                    pProgrammaticName = "ItemIndex",
                    type = UIAutomationType_Int
                };
                pRegistrar.RegisterProperty(propinfo, out UIA_ItemIndexPropertyId);
            }
            finally {
                if (pRegistrar != null)
                {
                    Marshal.ReleaseComObject(pRegistrar);
                }
            }
        }
Exemplo n.º 29
0
        public AutomationManager()
        {
            Guid   rclsid = CLSID_CUIAutomation;
            Guid   riid   = IID_IUIAutomation;
            object obj;

            PInvoke.CoCreateInstance(ref rclsid, IntPtr.Zero, 1, ref riid, out obj);
            if (obj == null)
            {
                return;
            }
            pAutomation = obj as IUIAutomation;

            lock (automationThread) {
                automationThread.Start(this);
                Monitor.Wait(automationThread);
            }
        }
 protected override void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         if (disposing)
         {
             if (this.IsHooked)
             {
                 IUIAutomation uia = this.IUIAutomation;
                 if (uia != null)
                 {
                     uia.RemovePropertyChangedEventHandler(this.Element, this);
                 }
             }
         }
     }
     base.Dispose(disposing);
 }
Exemplo n.º 31
0
        private bool disposedValue; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (IsHooked && this.UIAutomation != null)
                {
                    try
                    {
                        this.UIAutomation.RemoveFocusChangedEventHandler(this);
                        this.UIAutomation = null;
                    }
                    catch (ThreadAbortException)
                    {
                        // silently ignore exception since a ThreadAbortException is thrown at the process exit.
                    }
                }

                disposedValue = true;
            }
        }
Exemplo n.º 32
0
 public void Dispose()
 {
     if (automationThread.ThreadState != ThreadState.Stopped)
     {
         lock (automationThread) {
             killingThread = true;
             while (!threadDying)
             {
                 Monitor.PulseAll(automationThread);
                 Monitor.Wait(automationThread);
             }
         }
     }
     if (pAutomation != null)
     {
         Marshal.ReleaseComObject(pAutomation);
         pAutomation = null;
     }
     GC.SuppressFinalize(this);
 }
Exemplo n.º 33
0
        public ViewTree(IUIAutomationElement element, IUIAutomation automation)
        {
            this.root        = new TreeNode(element);
            this.root.parent = null;
            IUIAutomationElementArray array = element.FindAll(TreeScope.TreeScope_Children, automation.CreateTrueCondition());

            if (0 == array.Length)
            {
                this.root.children = null;
                this.root.isLeaf   = true;
            }
            else
            {
                for (int i = 0; i < array.Length; i++)
                {
                    IUIAutomationElement e = array.GetElement(i);
                    TreeNode             n = new TreeNode(e);
                    this.root.children.Add(n);
                }
            }
        }
        public void MyTestInitialize()
        {
            // Create the factory and register schemas
            _factory = new CUIAutomationClass();
            ReadyStateSchema.GetInstance().Register();
            TestSchema.GetInstance().Register();
            ColorSchema.GetInstance().Register();

            // Start the app
            var curDir = Environment.CurrentDirectory;
            _app = new TargetApp(curDir + "\\UiaControls.exe");
            _app.Start();

            // Find the main control
            var appElement = _factory.ElementFromHandle(_app.MainWindow);
            var condition = _factory.CreatePropertyCondition(
                UIA_PropertyIds.UIA_AutomationIdPropertyId,
                "triColorControl1");
            _customElement = appElement.FindFirst(TreeScope.TreeScope_Children,
                                                  condition);
            Assert.IsNotNull(_customElement);
        }
Exemplo n.º 35
0
 static AutomationElement() {
     Guid rclsid = CLSID_CUIAutomation;
     Guid riid = IID_IUIAutomation;
     object obj = null;
     PInvoke.CoCreateInstance(ref rclsid, IntPtr.Zero, 1, ref riid, out obj);
     if(obj == null) return;
     pAutomation = obj as IUIAutomation;
     
     rclsid = CLSID_CUIAutomationRegistrar;
     riid = IID_IUIAutomationRegistrar;
     PInvoke.CoCreateInstance(ref rclsid, IntPtr.Zero, 1, ref riid, out obj);
     IUIAutomationRegistrar pRegistrar = obj as IUIAutomationRegistrar;
     try {
         UIAutomationPropertyInfo propinfo;
         propinfo = new UIAutomationPropertyInfo {
             guid = ItemCount_Property_GUID,
             pProgrammaticName = "ItemCount",
             type = UIAutomationType_Int
         };
         pRegistrar.RegisterProperty(propinfo, out UIA_ItemCountPropertyId);
         propinfo = new UIAutomationPropertyInfo {
             guid = SelectedItemCount_Property_GUID,
             pProgrammaticName = "SelectedItemCount",
             type = UIAutomationType_Int
         };
         pRegistrar.RegisterProperty(propinfo, out UIA_SelectedCountPropertyId);
         propinfo = new UIAutomationPropertyInfo {
             guid = ItemIndex_Property_GUID,
             pProgrammaticName = "ItemIndex",
             type = UIAutomationType_Int
         };
         pRegistrar.RegisterProperty(propinfo, out UIA_ItemIndexPropertyId);   
     }
     finally {
         if(pRegistrar != null) Marshal.ReleaseComObject(pRegistrar);
     }
 }
Exemplo n.º 36
0
        /// <summary>
        /// Build a cacherequest for properties and patterns
        /// </summary>
        /// <param name="uia"></param>
        /// <param name="pps">Property ids</param>
        /// <param name="pts">Pattern ids</param>
        /// <returns></returns>
        public static IUIAutomationCacheRequest GetPropertiesCache(IUIAutomation uia, IEnumerable <int> pps, IEnumerable <int> pts)
        {
            if (uia == null)
            {
                throw new ArgumentNullException(nameof(uia));
            }

            var cr = uia.CreateCacheRequest();

            if (pps != null)
            {
                foreach (var pp in pps)
                {
                    cr.AddProperty(pp);
                }
            }

            IEnumerable <int> cps = Registrar.GetDefaultInstance().GetCustomPropertyRegistrations().Keys;

            foreach (var cp in cps)
            {
                cr.AddProperty(cp);
            }

            if (pts != null)
            {
                foreach (var pt in pts)
                {
                    if (pt != 0)
                    {
                        cr.AddPattern(pt);
                    }
                }
            }

            return(cr);
        }
Exemplo n.º 37
0
        public void MyTestInitialize()
        {
            // Create the factory and register schemas
            _factory = new CUIAutomationClass();
            ReadyStateSchema.GetInstance().Register();
            TestSchema.GetInstance().Register();
            ColorSchema.GetInstance().Register();

            // Start the app
            var curDir = Environment.CurrentDirectory;

            _app = new TargetApp(curDir + "\\UiaControls.exe");
            _app.Start();

            // Find the main control
            var appElement = _factory.ElementFromHandle(_app.MainWindow);
            var condition  = _factory.CreatePropertyCondition(
                UIA_PropertyIds.UIA_AutomationIdPropertyId,
                "triColorControl1");

            _customElement = appElement.FindFirst(TreeScope.TreeScope_Children,
                                                  condition);
            Assert.IsNotNull(_customElement);
        }
Exemplo n.º 38
0
 public WindowFactory(IUIAutomation uiAutomation, IKeyboard keyboard, IWinUserWrap winUserWrap)
 {
     this.uiAutomation = uiAutomation;
     this.keyboard = keyboard;
     this.winUserWrap = winUserWrap;
 }
Exemplo n.º 39
0
 public Element(AutomationElement element, IUIAutomation uiAutomation)
 {
     this.element = element;
     this.uiAutomation = uiAutomation;
 }
Exemplo n.º 40
0
 public UIAutomationService(IElementRepository elementRepository)
 {
     _automation = new CUIAutomation();
     _elementRepository = elementRepository;
 }
 public ActiveElementHandler(IUIAutomation uiAutomation, IOverlay overlay)
 {
     this.uiAutomation = uiAutomation;
     this.overlay = overlay;
 }
Exemplo n.º 42
0
 public UIOperator()
 {
     this._automation = new CUIAutomation();
 }
Exemplo n.º 43
0
 public WindowUtils(IUIAutomation uiAutomation, IWindowFactory windowFactory)
 {
     this.uiAutomation = uiAutomation;
     this.windowFactory = windowFactory;
 }
 internal AutomationElementFactory(IUIAutomation pAutomation) {
     disposeList = new List<AutomationElement>();
     this.pAutomation = pAutomation;
 }
Exemplo n.º 45
0
 public GetTitleHandler(IUIAutomation uiAutomation)
 {
     this.uiAutomation = uiAutomation;
 }
Exemplo n.º 46
0
 public void SetUIAutomation(IUIAutomation uiAutomation)
 {
     this.uiAutomation = uiAutomation;
 }
Exemplo n.º 47
0
 public FindElementsHandler(IUIAutomation uiAutomation)
 {
     this.uiAutomation = uiAutomation;
 }
Exemplo n.º 48
0
 public UIAutomationService(IElementRepository elementRepository)
 {
     _automation        = new CUIAutomation();
     _elementRepository = elementRepository;
 }
 public GetSourceHandler(IUIAutomation uiAutomation)
 {
     this.uiAutomation = uiAutomation;
 }
 public SelectionPattern(IUIAutomation automation, IUIAutomationElement element)
 {
     _element          = element;
     _automation       = automation;
     _selectionPattern = element.GetCurrentPattern(UIA_PatternIds.UIA_SelectionPatternId) as IUIAutomationSelectionPattern;
 }
Exemplo n.º 51
0
 public ElementSearcher(IUIAutomation uiAutomation, IElementFactory elementFactory)
 {
     this.uiAutomation = uiAutomation;
     this.elementFactory = elementFactory;
 }
Exemplo n.º 52
0
 public virtual IUIAutomationElement GetUIAutomationElement(IUIAutomation automation)
 {
     return automation.ElementFromHandle(new IntPtr(_handle));
 }
Exemplo n.º 53
0
 static void Uninitialize() {
     if(pAutomation != null) {
         Marshal.ReleaseComObject(pAutomation);
         pAutomation = null;
     }
 }