Пример #1
0
        //TODO While recording you get exception when clicking at the corner of the cell
        public override void HookEvents(IUIItemEventListener eventListener)
        {
            var safeAutomationEventHandler =
                new SafeAutomationEventHandler(this, eventListener, objs => ListViewEvent.Create(this, (AutomationPropertyChangedEventArgs)objs[0]));

            handler = safeAutomationEventHandler.PropertyChange;
            Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Descendants, handler, SelectionItemPattern.IsSelectedProperty);
        }
Пример #2
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = automationElement.RegisterPropertyChangedEvent(
         TreeScope.Element, delegate
     {
         ActionPerformed();
         eventListener.EventOccured(new CheckBoxEvent(this));
     }, TogglePattern.ToggleStateProperty);
 }
Пример #3
0
        //TODO While recording you get exception when clicking at the corner of the cell
        public override void HookEvents(IUIItemEventListener eventListener)
        {
            var safeAutomationEventHandler =
                new SafeAutomationEventHandler(this, eventListener, objs => ListViewEvent.Create(this, (AutomationPropertyChangedEventArgs)objs[0]));

            handler = AutomationElement.RegisterPropertyChangedEvent(TreeScope.Descendants, (element, property, obj) => safeAutomationEventHandler.PropertyChange(element, new AutomationPropertyChangedEventArgs {
                NewValue = obj
            }), SelectionItemPattern.IsSelectedProperty);
        }
Пример #4
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate(object sender, AutomationPropertyChangedEventArgs e)
                   {
                       if (e.NewValue.Equals(1)) return;
                       eventListener.EventOccured(new ListBoxEvent(this, SelectedItemText));
                   };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Descendants, handler, SelectionItemPattern.IsSelectedProperty);
 }
Пример #5
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate
                   {
                       ActionPerformed();
                       eventListener.EventOccured(new CheckBoxEvent(this));
                   };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Element, handler,
                                                         TogglePattern.ToggleStateProperty);
 }
Пример #6
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = automationElement.RegisterPropertyChangedEvent(
         TreeScope.Descendants, (sender, _, value) =>
     {
         if (value.Equals(1))
         {
             return;
         }
         eventListener.EventOccured(new ListBoxEvent(this, SelectedItemText));
     }, SelectionItemPattern.IsSelectedProperty);
 }
Пример #7
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     lastSelectedItem = SelectedItem;
     handler = delegate(object sender, AutomationPropertyChangedEventArgs e)
                   {
                       if (SelectedItem == null || e.NewValue.Equals(1)) return;
                       if (SameListItem()) return;
                       lastSelectedItem = SelectedItem;
                       eventListener.EventOccured(new ComboBoxEvent(this, SelectedItemText));
                   };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Element, handler, ExpandCollapsePattern.ExpandCollapseStateProperty);
 }
Пример #8
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate(object sender, AutomationPropertyChangedEventArgs e)
     {
         if (e.NewValue.Equals(1))
         {
             return;
         }
         eventListener.EventOccured(new ListBoxEvent(this, SelectedItemText));
     };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Descendants, handler, SelectionItemPattern.IsSelectedProperty);
 }
Пример #9
0
        public override void HookEvents(IUIItemEventListener eventListener)
        {
            clickedTreeNodeHandler = AutomationElement.RegisterPropertyChangedEvent(TreeScope.Subtree, delegate
            {
                TreeNode node = ClickedNode;
                eventListener.EventOccured(new TreeNodeClickedEvent(this, node, node.IsExpanded()));
            }, ExpandCollapsePattern.ExpandCollapseStateProperty);

            selectedTreeNodeHandler = AutomationElement.RegisterPropertyChangedEvent(TreeScope.Subtree, delegate
            {
                TreeNode node = SelectedNode;
                eventListener.EventOccured((new TreeNodeSelectEvent(this, node)));
            }, SelectionItemPattern.IsSelectedProperty);
        }
Пример #10
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     lastSelectedItem = SelectedItem;
     handler          = automationElement.RegisterPropertyChangedEvent(TreeScope.Element, (sender, e, value) =>
     {
         if (SelectedItem == null || value.Equals(1))
         {
             return;
         }
         if (SameListItem())
         {
             return;
         }
         lastSelectedItem = SelectedItem;
         eventListener.EventOccured(new ComboBoxEvent(this, SelectedItemText));
     }, ExpandCollapsePattern.ExpandCollapseStateProperty);
 }
Пример #11
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     lastSelectedItem = SelectedItem;
     handler          = delegate(object sender, AutomationPropertyChangedEventArgs e)
     {
         if (SelectedItem == null || e.NewValue.Equals(1))
         {
             return;
         }
         if (SameListItem())
         {
             return;
         }
         lastSelectedItem = SelectedItem;
         eventListener.EventOccured(new ComboBoxEvent(this, SelectedItemText));
     };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Element, handler, ExpandCollapsePattern.ExpandCollapseStateProperty);
 }
Пример #12
0
        public override void HookEvents(IUIItemEventListener eventListener)
        {
            clickedTreeNodeHandler = delegate
            {
                TreeNode node = ClickedNode;
                eventListener.EventOccured((new TreeNodeClickedEvent(this, node, node.IsExpanded())));
            };

            selectedTreeNodeHandler = delegate
            {
                TreeNode node = SelectedNode;
                eventListener.EventOccured((new TreeNodeSelectEvent(this, node)));
            };

            Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Subtree, clickedTreeNodeHandler,
                                                                ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty);
            Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Subtree, selectedTreeNodeHandler,
                                                                SelectionItemPatternIdentifiers.IsSelectedProperty);
        }
Пример #13
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = automationElement.RegisterPropertyChangedEvent(
         TreeScope.Descendants, delegate { eventListener.EventOccured(new TabEvent(this)); },
         SelectionItemPattern.IsSelectedProperty);
 }
Пример #14
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new TextBoxEvent(this)); };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Element, handler, ValuePattern.ValueProperty);
 }
 public SafeAutomationEventHandler(IUIItem uiItem, IUIItemEventListener eventListener, Create createUserEvent)
 {
     this.uiItem          = uiItem;
     this.eventListener   = eventListener;
     this.createUserEvent = createUserEvent;
 }
Пример #16
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { };
     Automation.AddAutomationEventHandler(AutomationElement.MenuOpenedEvent, automationElement,
                                          TreeScope.Descendants, handler);
 }
Пример #17
0
 public SafeAutomationEventHandler(IUIItem uiItem, IUIItemEventListener eventListener, Create createUserEvent)
 {
     this.uiItem = uiItem;
     this.eventListener = eventListener;
     this.createUserEvent = createUserEvent;
 }
Пример #18
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new TabEvent(this)); };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Descendants, handler, SelectionItemPattern.IsSelectedProperty);
 }
Пример #19
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new TextBoxEvent(this)); };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Element, handler, ValuePattern.ValueProperty);
 }
Пример #20
0
 protected virtual void HookClickEvent(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new UIItemClickEvent(this)); };
     Automation.AddAutomationEventHandler(InvokePattern.InvokedEvent, automationElement, TreeScope.Element,
                                          handler);
 }
Пример #21
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new TabEvent(this)); };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Descendants, handler, SelectionItemPattern.IsSelectedProperty);
 }
Пример #22
0
        public override void HookEvents(IUIItemEventListener eventListener)
        {
            clickedTreeNodeHandler = delegate
                                         {
                                             TreeNode node = ClickedNode;
                                             eventListener.EventOccured((new TreeNodeClickedEvent(this, node, node.IsExpanded())));
                                         };

            selectedTreeNodeHandler = delegate
                                          {
                                              TreeNode node = SelectedNode;
                                              eventListener.EventOccured((new TreeNodeSelectEvent(this, node)));
                                          };

            Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Subtree, clickedTreeNodeHandler,
                                                                ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty);
            Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Subtree, selectedTreeNodeHandler,
                                                                SelectionItemPatternIdentifiers.IsSelectedProperty);
        }
Пример #23
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     HookClickEvent(eventListener);
 }
Пример #24
0
 //TODO While recording you get exception when clicking at the corner of the cell
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     var safeAutomationEventHandler =
         new SafeAutomationEventHandler(this, eventListener, objs => ListViewEvent.Create(this, (AutomationPropertyChangedEventArgs) objs[0]));
     handler = safeAutomationEventHandler.PropertyChange;
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Descendants, handler, SelectionItemPattern.IsSelectedProperty);
 }
Пример #25
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = automationElement.RegisterPropertyChangedEvent(
         TreeScope.Element, delegate { eventListener.EventOccured(new TextBoxEvent(this)); },
         ValuePattern.ValueProperty);
 }
Пример #26
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = automationElement.RegisterEvent(SelectionItemPattern.ElementSelectedEvent, TreeScope.Element, delegate { eventListener.EventOccured(new RadioButtonEvent(this)); });
 }
Пример #27
0
 /// <summary>
 /// Implements <see cref="IUIItem.HookEvents"/>
 /// </summary>
 public virtual void HookEvents(IUIItemEventListener eventListener)
 {
 }
Пример #28
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { };
     Automation.AddAutomationEventHandler(AutomationElement.MenuOpenedEvent, automationElement,
                                          TreeScope.Descendants, handler);
 }
Пример #29
0
 protected virtual void HookClickEvent(IUIItemEventListener eventListener)
 {
     handler = automationElement.RegisterEvent(InvokePattern.InvokedEvent, TreeScope.Element, delegate { eventListener.EventOccured(new UIItemClickEvent(this)); });
 }
Пример #30
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new RadioButtonEvent(this)); };
     Automation.AddAutomationEventHandler(SelectionItemPattern.ElementSelectedEvent, automationElement, TreeScope.Element, handler);
 }
Пример #31
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     HookClickEvent(eventListener);
 }
Пример #32
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = AutomationElement.RegisterEvent(AutomationObjectIds.MenuOpenedEvent, TreeScope.Descendants,
                                               (element, id) => { });
 }