System.Windows.Automation.AutomationEvent.LookupById C# (CSharp) Method

LookupById() public static method

public static LookupById ( int id ) : AutomationEvent
id int
return AutomationEvent
        public static AutomationEvent LookupById(int id)
        {
            return (AutomationEvent)AutomationIdentifier.LookupById(UiaCoreIds.AutomationIdType.Event, id);
        }

Usage Example

示例#1
0
        void IUIAutomationEventHandler.HandleAutomationEvent(
            IUIAutomationElement sender,
            int eventId)
        {
            AutomationElement automationElement = null;

            if (sender != null)
            {
                automationElement = new AutomationElement(autoElement: sender);
            }
            if (eventId == 20017)
            {
                this._handlingDelegate(sender: automationElement, e: new WindowClosedEventArgs(runtimeId: automationElement.GetRuntimeId()));
            }
            else
            {
                this._handlingDelegate(sender: automationElement, e: new AutomationEventArgs(eventId: AutomationEvent.LookupById(id: eventId)));
            }
        }