나. 클라이언트용 UI 자동화 이벤트

이 책에서는 UI 자동화 클라이언트 응용과 보조 기술에서 UI 자동화 기술을 사용하는 방법을 중점으로 소개하고 있습니다. 이제 클라이언트용 UI 자동화 이벤트를 살펴봅시다.

클라이언트용 UI 자동화 이벤트에서는 Automation 클래스의 정적 메소드를 사용하여 원하는 UI 자동화 이벤트를 구독 및 제거할 수 있습니다.

public static void AddAutomationFocusChangedEventHandler(
           AutomationFocusChangedEventHandler eventHandler)

초점 변경 이벤트 핸들러를 등록합니다.

public static void AddAutomationPropertyChangedEventHandler(
           AutomationElement element, TreeScope scope,
           AutomationPropertyChangedEventHandler eventHandler,
           params AutomationProperty[] properties)

속성 변경 이벤트 핸들러를 등록합니다. UI 자동화 요소와 처리할 이벤트 범위와 이벤트 핸들러를 입력 인자로 전달합니다.

public static void AddStructureChangedEventHandler(
           AutomationElement element, TreeScope scope,
           StructureChangedEventHandler eventHandler)

구조 변경 이벤트 핸들러를 등록합니다. UI 자동화 요소와 처리할 이벤트 범위와 이벤트 핸드러를 입력 인자로 전달합니다.

public static void AddAutomationEventHandler(
           AutomationEvent eventId, AutomationElement element,
           TreeScope scope, AutomationEventHandler eventHandler)

UI 자동화 이벤트 핸들러를 등록합니다. 이벤트 핸들러에서 처리할 이벤트 식별자와 자동화 요소 및 처리할 이벤트 범위와 이벤트 핸들러를 입력 인자로 전달합니다.

public static void RemoveAutomationEventHandler(
           AutomationEvent eventId, AutomationElement element,
           AutomationEventHandler eventHandler)

UI 자동화 이벤트 핸드러를 제거합니다. 이벤트 식별자와 자동화 요소 및 이벤트 핸들러를 입력 인자로 전달합니다.

public static void RemoveAutomationFocusChangedEventHandler(
           AutomationFocusChangedEventHandler eventHandler)

초점 변경 이벤트 핸들러를 제거합니다.

public static void RemoveAutomationPropertyChangedEventHandler(
           AutomationElement element,
           AutomationPropertyChangedEventHandler eventHandler)

속성 변경 이벤트 핸들러를 제거합니다. 입력 인자로 자동화 요소와 이벤트 핸드러를 전달합니다.

public static void RemoveAllEventHandlers()

등록한 모든 자동화 이벤트 핸들러를 제거합니다.