Пример #1
0
        public ListItem(IRawElementProviderSimple provider) : base(provider)
        {
            invokeProvider        = (IInvokeProvider)provider.GetPatternProvider(InvokePatternIdentifiers.Pattern.Id);
            selectionItemProvider = (ISelectionItemProvider)provider.GetPatternProvider(SelectionItemPatternIdentifiers.Pattern.Id);
            if (selectionItemProvider == null)
            {
                throw new ArgumentException("ListItem should always implement ISelectionItemProvider");
            }
            toggleProvider = (IToggleProvider)provider.GetPatternProvider(TogglePatternIdentifiers.Pattern.Id);

            textExpert         = TextImplementorFactory.GetImplementor(this, provider);
            imageExpert        = new ImageImplementorHelper(this);
            actionExpert       = new ActionImplementorHelper();
            editableTextExpert = new EditableTextImplementorHelper(this, this, textExpert);

            // TODO: Localize the name?s
            actionExpert.Add("click", "click", null, DoClick);
            if (toggleProvider != null)
            {
                actionExpert.Add("toggle", "toggle", null, DoToggle);
            }
            if (invokeProvider != null)
            {
                actionExpert.Add("invoke", "invoke", null, DoInvoke);
            }
            Role = (toggleProvider != null? Atk.Role.CheckBox: Atk.Role.ListItem);
        }
Пример #2
0
        public TreeItem(IRawElementProviderSimple provider) : base(provider)
        {
            invokeProvider        = (IInvokeProvider)provider.GetPatternProvider(InvokePatternIdentifiers.Pattern.Id);
            selectionItemProvider = (ISelectionItemProvider)provider.GetPatternProvider(SelectionItemPatternIdentifiers.Pattern.Id);

            expandCollapseProvider = provider.GetPatternProvider(
                ExpandCollapsePatternIdentifiers.Pattern.Id) as IExpandCollapseProvider;

            textExpert   = TextImplementorFactory.GetImplementor(this, provider);
            actionExpert = new ActionImplementorHelper();

            // TODO: Localize the name?s
            actionExpert.Add("click", "click", null, DoClick);
            if (ToggleProvider != null)
            {
                actionExpert.Add("toggle", "toggle", null, DoToggle);
            }
            if (invokeProvider != null)
            {
                actionExpert.Add("invoke", "invoke", null, DoInvoke);
            }

            IRawElementProviderFragment fragment = Provider as IRawElementProviderFragment;

            if (fragment != null && fragment.Navigate(NavigateDirection.FirstChild) != null)
            {
                AddExpandContractAction();
            }

            Role = (ToggleProvider != null? Atk.Role.CheckBox: Atk.Role.TableCell);

            imageExpert        = new ImageImplementorHelper(this);
            editableTextExpert = new EditableTextImplementorHelper(this, this, textExpert);
        }
Пример #3
0
		public TreeItem (IRawElementProviderSimple provider) : base (provider)
		{
			invokeProvider = (IInvokeProvider)provider.GetPatternProvider(InvokePatternIdentifiers.Pattern.Id);
			selectionItemProvider = (ISelectionItemProvider)provider.GetPatternProvider(SelectionItemPatternIdentifiers.Pattern.Id);

			expandCollapseProvider = provider.GetPatternProvider (
				ExpandCollapsePatternIdentifiers.Pattern.Id) as IExpandCollapseProvider;

			textExpert = TextImplementorFactory.GetImplementor (this, provider);
			actionExpert = new ActionImplementorHelper ();

			// TODO: Localize the name?s
			actionExpert.Add ("click", "click", null, DoClick);
			if (ToggleProvider != null)
				actionExpert.Add ("toggle", "toggle", null, DoToggle);
			if (invokeProvider != null)
				actionExpert.Add ("invoke", "invoke", null, DoInvoke);

			IRawElementProviderFragment fragment = Provider as IRawElementProviderFragment;
			if (fragment != null && fragment.Navigate (NavigateDirection.FirstChild) != null)
				AddExpandContractAction ();

			Role = (ToggleProvider != null? Atk.Role.CheckBox: Atk.Role.TableCell);

			imageExpert = new ImageImplementorHelper (this);
			editableTextExpert = new EditableTextImplementorHelper (this, this, textExpert);
		}
Пример #4
0
		protected override void InitializeAdditionalProviders ()
		{
			selProvider = (ISelectionItemProvider)Provider.GetPatternProvider (SelectionItemPatternIdentifiers.Pattern.Id);
			if (selProvider == null)
				throw new ArgumentException ("The provider for RadioButton should implement the SelectionItem pattern");
			imageImplementor = new ImageImplementorHelper (this);
			actionName = "click";
		}
Пример #5
0
		public CheckBoxButton (IRawElementProviderSimple provider) : base (provider)
		{
			toggleProvider = (IToggleProvider) provider.GetPatternProvider (TogglePatternIdentifiers.Pattern.Id);
			imageImplementor = new ImageImplementorHelper (this);
			if (toggleProvider == null)
				throw new ArgumentException ("The provider for CheckBox should implement the Toggle pattern");

			Role = Atk.Role.CheckBox;
		}
Пример #6
0
 protected override void InitializeAdditionalProviders()
 {
     selProvider = (ISelectionItemProvider)Provider.GetPatternProvider(SelectionItemPatternIdentifiers.Pattern.Id);
     if (selProvider == null)
     {
         throw new ArgumentException("The provider for RadioButton should implement the SelectionItem pattern");
     }
     imageImplementor = new ImageImplementorHelper(this);
     actionName       = "click";
 }
Пример #7
0
        public ToggleButton(IRawElementProviderSimple provider) : base(provider)
        {
            toggleProvider   = (IToggleProvider)provider.GetPatternProvider(TogglePatternIdentifiers.Pattern.Id);
            imageImplementor = new ImageImplementorHelper(this);
            if (toggleProvider == null)
            {
                throw new ArgumentException("The provider for ToggleButton should implement the Toggle pattern");
            }

            Role = Atk.Role.ToggleButton;
        }
Пример #8
0
        public Image(IRawElementProviderSimple provider) : base(provider)
        {
            // Perhaps we should use Atk.Role.Image instead,
            // but gail uses Atk.Role.Icon
            // If we decide to use Image instead, we may need to
            // separate BalloonWindow handling, since it should
            // have Atk.Role.Icon.
            Role = Atk.Role.Icon;

            imageImplementor = new ImageImplementorHelper(this);
        }
Пример #9
0
		public Image (IRawElementProviderSimple provider) : base (provider)
		{		
			// Perhaps we should use Atk.Role.Image instead,
			// but gail uses Atk.Role.Icon
			// If we decide to use Image instead, we may need to
			// separate BalloonWindow handling, since it should
			// have Atk.Role.Icon.
			Role = Atk.Role.Icon;
			
			imageImplementor = new ImageImplementorHelper (this);
		}
Пример #10
0
		public HeaderItem (IRawElementProviderSimple provider) : base (provider)
		{
			Role = Atk.Role.TableColumnHeader;

			invokeProvider = (IInvokeProvider) provider.GetPatternProvider (InvokePatternIdentifiers.Pattern.Id);		
			imageExpert = new ImageImplementorHelper (this); 

			actionExpert = new ActionImplementorHelper ();
			if (invokeProvider != null)
				actionExpert.Add ("click", "click", null, DoClick);
		}
Пример #11
0
		// UI Automation Properties supported
		// AutomationElementIdentifiers.AcceleratorKeyProperty.Id
		// AutomationIdProperty() ?
		// AutomationElementIdentifiers.BoundingRectangleProperty.Id
		// AutomationElementIdentifiers.ClickablePointProperty.Id
		// AutomationElementIdentifiers.ControlTypeProperty.Id
		// AutomationElementIdentifiers.HelpTextProperty.Id
		// AutomationElementIdentifiers.IsContentElementProperty.Id
		// AutomationElementIdentifiers.IsControlElementProperty.Id
		// AutomationElementIdentifiers.IsKeyboardFocusableProperty.Id
		// AutomationElementIdentifiers.LabeledByProperty.Id
		// AutomationElementIdentifiers.LocalizedControlTypeProperty.Id
		// AutomationElementIdentifiers.NameProperty.Id
		public Button (IRawElementProviderSimple provider) : base (provider)
		{
			invokeProvider = (IInvokeProvider)provider.GetPatternProvider(InvokePatternIdentifiers.Pattern.Id);
			imageImplementor = new ImageImplementorHelper (this);
			InitializeAdditionalProviders ();
			if (invokeProvider != null) {
				//it seems the default description should be null
				actionName = default_invoke_name;
				Role = Atk.Role.PushButton;
			}

			textExpert = TextImplementorFactory.GetImplementor (this, provider);
		}
Пример #12
0
        public HeaderItem(IRawElementProviderSimple provider) : base(provider)
        {
            Role = Atk.Role.TableColumnHeader;

            invokeProvider = (IInvokeProvider)provider.GetPatternProvider(InvokePatternIdentifiers.Pattern.Id);
            imageExpert    = new ImageImplementorHelper(this);

            actionExpert = new ActionImplementorHelper();
            if (invokeProvider != null)
            {
                actionExpert.Add("click", "click", null, DoClick);
            }
        }
Пример #13
0
        // UI Automation Properties supported
        // AutomationElementIdentifiers.AcceleratorKeyProperty.Id
        // AutomationIdProperty() ?
        // AutomationElementIdentifiers.BoundingRectangleProperty.Id
        // AutomationElementIdentifiers.ClickablePointProperty.Id
        // AutomationElementIdentifiers.ControlTypeProperty.Id
        // AutomationElementIdentifiers.HelpTextProperty.Id
        // AutomationElementIdentifiers.IsContentElementProperty.Id
        // AutomationElementIdentifiers.IsControlElementProperty.Id
        // AutomationElementIdentifiers.IsKeyboardFocusableProperty.Id
        // AutomationElementIdentifiers.LabeledByProperty.Id
        // AutomationElementIdentifiers.LocalizedControlTypeProperty.Id
        // AutomationElementIdentifiers.NameProperty.Id
        public Button(IRawElementProviderSimple provider) : base(provider)
        {
            invokeProvider   = (IInvokeProvider)provider.GetPatternProvider(InvokePatternIdentifiers.Pattern.Id);
            imageImplementor = new ImageImplementorHelper(this);
            InitializeAdditionalProviders();
            if (invokeProvider != null)
            {
                //it seems the default description should be null
                actionName = default_invoke_name;
                Role       = Atk.Role.PushButton;
            }

            textExpert = TextImplementorFactory.GetImplementor(this, provider);
        }
Пример #14
0
		public ListItem (IRawElementProviderSimple provider) : base (provider)
		{
			invokeProvider = (IInvokeProvider)provider.GetPatternProvider(InvokePatternIdentifiers.Pattern.Id);
			selectionItemProvider = (ISelectionItemProvider)provider.GetPatternProvider(SelectionItemPatternIdentifiers.Pattern.Id);
			if (selectionItemProvider == null)
				throw new ArgumentException ("ListItem should always implement ISelectionItemProvider");
			toggleProvider = (IToggleProvider) provider.GetPatternProvider (TogglePatternIdentifiers.Pattern.Id);

			textExpert = TextImplementorFactory.GetImplementor (this, provider);
			imageExpert = new ImageImplementorHelper (this);
			actionExpert = new ActionImplementorHelper ();
			editableTextExpert = new EditableTextImplementorHelper (this, this, textExpert);

			// TODO: Localize the name?s
			actionExpert.Add ("click", "click", null, DoClick);
			if (toggleProvider != null)
				actionExpert.Add ("toggle", "toggle", null, DoToggle);
			if (invokeProvider != null)
				actionExpert.Add ("invoke", "invoke", null, DoInvoke);
			Role = (toggleProvider != null? Atk.Role.CheckBox: Atk.Role.ListItem);
		}
Пример #15
0
		public TextImageLabel (IRawElementProviderSimple provider) : base (provider)
		{
			imageImplementor = new ImageImplementorHelper (this);
		}
Пример #16
0
 public TextImageLabel(IRawElementProviderSimple provider) : base(provider)
 {
     imageImplementor = new ImageImplementorHelper(this);
 }