Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = automationElement.RegisterPropertyChangedEvent(
         TreeScope.Element, delegate
     {
         ActionPerformed();
         eventListener.EventOccured(new CheckBoxEvent(this));
     }, TogglePattern.ToggleStateProperty);
 }
Ejemplo n.º 3
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);
 }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate
                   {
                       ActionPerformed();
                       eventListener.EventOccured(new CheckBoxEvent(this));
                   };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Element, handler,
                                                         TogglePattern.ToggleStateProperty);
 }
Ejemplo n.º 6
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);
 }
Ejemplo n.º 7
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);
 }
        public virtual void PropertyChange(object sender, AutomationPropertyChangedEventArgs e)
        {
            UserEvent userEvent = UserEvent(e);

            if (null == userEvent)
            {
                return;
            }
            try
            {
                eventListener.EventOccured(userEvent);
            }
            catch (Exception exception)
            {
                logger.Error("", exception);
            }
        }
Ejemplo n.º 9
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);
 }
Ejemplo n.º 10
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);
 }
Ejemplo n.º 11
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = automationElement.RegisterPropertyChangedEvent(
         TreeScope.Descendants, delegate { eventListener.EventOccured(new TabEvent(this)); },
         SelectionItemPattern.IsSelectedProperty);
 }
Ejemplo n.º 12
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new TextBoxEvent(this)); };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Element, handler, ValuePattern.ValueProperty);
 }
Ejemplo n.º 13
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new TextBoxEvent(this)); };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Element, handler, ValuePattern.ValueProperty);
 }
Ejemplo n.º 14
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new TabEvent(this)); };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Descendants, handler, SelectionItemPattern.IsSelectedProperty);
 }
Ejemplo n.º 15
0
 protected virtual void HookClickEvent(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new UIItemClickEvent(this)); };
     Automation.AddAutomationEventHandler(InvokePattern.InvokedEvent, automationElement, TreeScope.Element,
                                          handler);
 }
Ejemplo n.º 16
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);
 }
Ejemplo n.º 17
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new TabEvent(this)); };
     Automation.AddAutomationPropertyChangedEventHandler(automationElement, TreeScope.Descendants, handler, SelectionItemPattern.IsSelectedProperty);
 }
Ejemplo n.º 18
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = delegate { eventListener.EventOccured(new RadioButtonEvent(this)); };
     Automation.AddAutomationEventHandler(SelectionItemPattern.ElementSelectedEvent, automationElement, TreeScope.Element, handler);
 }
Ejemplo n.º 19
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = automationElement.RegisterEvent(SelectionItemPattern.ElementSelectedEvent, TreeScope.Element, delegate { eventListener.EventOccured(new RadioButtonEvent(this)); });
 }
Ejemplo n.º 20
0
 protected virtual void HookClickEvent(IUIItemEventListener eventListener)
 {
     handler = automationElement.RegisterEvent(InvokePattern.InvokedEvent, TreeScope.Element, delegate { eventListener.EventOccured(new UIItemClickEvent(this)); });
 }
Ejemplo n.º 21
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);
        }
Ejemplo n.º 22
0
 public override void HookEvents(IUIItemEventListener eventListener)
 {
     handler = automationElement.RegisterPropertyChangedEvent(
         TreeScope.Element, delegate { eventListener.EventOccured(new TextBoxEvent(this)); },
         ValuePattern.ValueProperty);
 }