Exemplo n.º 1
0
        /// <summary>
        /// Removes a previously added property changed event handler
        /// </summary>
        /// <param name="hWnd">window handle</param>
        /// <param name="property">the property to remove</param>
        /// <param name="element">the control in the window</param>
        /// <param name="eventHandler">the eveht handler to remove</param>
        static public void RemoveAutomationPropertyChangedEventHandler(IntPtr hWnd,
                                                                       AutomationProperty property,
                                                                       AutomationElement element,
                                                                       AutomationPropertyChangedEventHandler eventHandler)
        {
            Log.Debug();

            if (hWnd == IntPtr.Zero)
            {
                return;
            }

            lock (WindowTable)
            {
                var windowElement = (WindowElement)WindowTable[hWnd];
                if (windowElement != null)
                {
                    var item = new RemoveAutomationPropertyChangedItem
                    {
                        Property     = property,
                        AutoElement  = element,
                        EventHandler = eventHandler,
                        WinElement   = windowElement
                    };

                    RemoveAutomationPropertyChanged(item);
                    //windowElement.RemoveAutomationPropertyChangedEventHandler(element, property, eventHandler);
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Enqueues the item for asynchronous handling
 /// </summary>
 /// <param name="item">item to add</param>
 private static void RemoveAutomationPropertyChanged(RemoveAutomationPropertyChangedItem item)
 {
     _instance._queue.Enqueue(item);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Enqueues the item for asynchronous handling
 /// </summary>
 /// <param name="item">item to add</param>
 private static void RemoveAutomationPropertyChanged(RemoveAutomationPropertyChangedItem item)
 {
     _instance._queue.Enqueue(item);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Removes a previously added property changed event handler
        /// </summary>
        /// <param name="hWnd">window handle</param>
        /// <param name="property">the property to remove</param>
        /// <param name="element">the control in the window</param>
        /// <param name="eventHandler">the eveht handler to remove</param>
        static public void RemoveAutomationPropertyChangedEventHandler(IntPtr hWnd,
                                                                AutomationProperty property,
                                                                AutomationElement element,
                                                                AutomationPropertyChangedEventHandler eventHandler)
        {
            Log.Debug();

            if (hWnd == IntPtr.Zero)
            {
                return;
            }

            lock (WindowTable)
            {
                var windowElement = (WindowElement)WindowTable[hWnd];
                if (windowElement != null)
                {
                    var item = new RemoveAutomationPropertyChangedItem
                    {
                        Property = property,
                        AutoElement = element,
                        EventHandler = eventHandler,
                        WinElement = windowElement
                    };

                    RemoveAutomationPropertyChanged(item);
                    //windowElement.RemoveAutomationPropertyChangedEventHandler(element, property, eventHandler);
                }
            }
        }