Inheritance: EventHandlerBase
Beispiel #1
0
        public void TestStructureChangeEvent()
        {
            StructureChangeHandler handler = new StructureChangeHandler();

            Automation.AddStructureChangedEventHandler(
                AutomationElement.RootElement,
                TreeScope.Subtree,
                new StructureChangedEventHandler(handler.HandleEvent));
            handler.Start();

            // Start Notepad to get a structure change event
            using (AppHost host = new AppHost("notepad.exe", ""))
            {
            }

            Assert.IsTrue(handler.Confirm());
            Assert.IsNotNull(handler.EventSource);
            Automation.RemoveStructureChangedEventHandler(
                AutomationElement.RootElement,
                new StructureChangedEventHandler(handler.HandleEvent));
        }
Beispiel #2
0
        public void TestStructureChangeEvent()
        {
            StructureChangeHandler handler = new StructureChangeHandler();
            Automation.AddStructureChangedEventHandler(
                AutomationElement.RootElement,
                TreeScope.Subtree,
                new StructureChangedEventHandler(handler.HandleEvent));
            handler.Start();

            // Start Notepad to get a structure change event
            using (AppHost host = new AppHost("notepad.exe", ""))
            {
            }

            Assert.IsTrue(handler.Confirm());
            Assert.IsNotNull(handler.EventSource);
            Automation.RemoveStructureChangedEventHandler(
                AutomationElement.RootElement,
                new StructureChangedEventHandler(handler.HandleEvent));
        }