예제 #1
0
        public void AddRootElementAutomationEventHandler(int eventId, TreeScope scope, int handlerId)
        {
            var handlerData = new AutomationEventHandlerData(eventId,
                                                             null, scope, handlerId, true);

            lock (automationEventHandlers)
                automationEventHandlers.Add(handlerData);
        }
예제 #2
0
        public void AddRootElementStructureChangedEventHandler(TreeScope scope, int handlerId)
        {
            var handlerData = new AutomationEventHandlerData(
                AutomationElementIdentifiers.StructureChangedEvent.Id,
                null, scope, handlerId, true);

            lock (structureEventHandlers)
                structureEventHandlers.Add(handlerData);
        }
예제 #3
0
        public void AddAutomationEventHandler(int eventId, int [] elementRuntimeId,
                                              TreeScope scope, int handlerId)
        {
            var provider = AutomationBridge.Instance.FindProviderByRuntimeId(elementRuntimeId);

            if (provider == null)
            {
                return;
            }
            AutomationEventHandlerData handlerData =
                new AutomationEventHandlerData(eventId, provider, scope, handlerId, false);

            lock (automationEventHandlers)
                automationEventHandlers.Add(handlerData);
        }
예제 #4
0
        public void AddStructureChangedEventHandler(int [] elementRuntimeId,
                                                    TreeScope scope, int handlerId)
        {
            var provider = AutomationBridge.Instance.FindProviderByRuntimeId(elementRuntimeId);

            if (provider == null)
            {
                return;
            }
            AutomationEventHandlerData handlerData =
                new AutomationEventHandlerData(
                    AutomationElementIdentifiers.StructureChangedEvent.Id,
                    provider, scope, handlerId, false);

            lock (structureEventHandlers)
                structureEventHandlers.Add(handlerData);
        }