Exemple #1
0
        public ComboBox(IRawElementProviderSimple provider) : base(provider)
        {
            if (!(provider is IRawElementProviderFragment))
            {
                throw new ArgumentException("Provider should be IRawElementProviderFragment");
            }

            this.Role = Atk.Role.ComboBox;

            selProvider = (ISelectionProvider)provider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);

            if (selProvider == null)
            {
                throw new ArgumentException("ComboBoxProvider should always implement ISelectionProvider");
            }

            selectionHelper =
                new SelectionProviderUserHelper((IRawElementProviderFragment)Provider,
                                                selProvider, true);

            var providersSelected = selProvider.GetSelection();

            if (providersSelected != null && providersSelected.Length == 1)
            {
                Name = (string)providersSelected [0].GetPropertyValue(AEIds.NameProperty.Id);
            }
        }
Exemple #2
0
		public DataGrid (IRawElementProviderFragment provider): base (provider)
		{
			selectionProvider = (ISelectionProvider)provider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
			if (selectionProvider == null)
				throw new ArgumentException ("DataGrid should always implement ISelectionProvider");
			selectionHelper = new SelectionProviderUserHelper (provider, selectionProvider);
		}
Exemple #3
0
		public Tab (IRawElementProviderFragment provider): base (provider)
		{
			selectionProvider = (ISelectionProvider)provider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
			if (selectionProvider == null)
				throw new ArgumentException ("List should always implement ISelectionProvider");
			
			selectionHelper = new SelectionProviderUserHelper (provider, selectionProvider);
			Role = Atk.Role.PageTabList;
		}
Exemple #4
0
 public DataGrid(IRawElementProviderFragment provider) : base(provider)
 {
     selectionProvider = (ISelectionProvider)provider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
     if (selectionProvider == null)
     {
         throw new ArgumentException("DataGrid should always implement ISelectionProvider");
     }
     selectionHelper = new SelectionProviderUserHelper(provider, selectionProvider);
 }
Exemple #5
0
        public Tab(IRawElementProviderFragment provider) : base(provider)
        {
            selectionProvider = (ISelectionProvider)provider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
            if (selectionProvider == null)
            {
                throw new ArgumentException("List should always implement ISelectionProvider");
            }

            selectionHelper = new SelectionProviderUserHelper(provider, selectionProvider);
            Role            = Atk.Role.PageTabList;
        }
Exemple #6
0
		public ListGroup (IRawElementProviderFragment provider): base (provider)
		{
			tableExpert = new TableImplementorHelper (this);

			IRawElementProviderFragment listProvider = provider.Navigate (NavigateDirection.Parent);
			selectionProvider = (ISelectionProvider)listProvider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
			if (selectionProvider == null)
				throw new ArgumentException ("List should always implement ISelectionProvider");
			
			selectionHelper = new SelectionProviderUserHelper (provider, selectionProvider);
			Role = Atk.Role.LayeredPane;
		}
Exemple #7
0
        public ListGroup(IRawElementProviderFragment provider) : base(provider)
        {
            tableExpert = new TableImplementorHelper(this);

            IRawElementProviderFragment listProvider = provider.Navigate(NavigateDirection.Parent);

            selectionProvider = (ISelectionProvider)listProvider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
            if (selectionProvider == null)
            {
                throw new ArgumentException("List should always implement ISelectionProvider");
            }

            selectionHelper = new SelectionProviderUserHelper(provider, selectionProvider);
            Role            = Atk.Role.LayeredPane;
        }
Exemple #8
0
		public ComboBoxOptions (IRawElementProviderSimple provider) : base (provider)
		{
			if (provider == null)
				throw new ArgumentNullException ("provider");

			if ((provider as IRawElementProviderFragment) == null)
				throw new ArgumentException ("Provider for ParentMenu should be IRawElementProviderFragment");

			selectionProvider = (ISelectionProvider)provider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
			if (selectionProvider == null)
				throw new ArgumentException ("The List inside the ComboBox should always implement ISelectionProvider");

			selectionHelper = new SelectionProviderUserHelper (provider as IRawElementProviderFragment, selectionProvider);

			Role = Atk.Role.Menu;
		}
Exemple #9
0
        public Tree(IRawElementProviderFragment provider) : base(provider)
        {
            this.provider = provider;

            selectionProvider = (ISelectionProvider)provider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
            if (selectionProvider == null)
            {
                throw new ArgumentException("Tree should always implement ISelectionProvider");
            }

            tableExpert = new TableImplementorHelper(this);

            Role = Atk.Role.TreeTable;

            selectionHelper = new SelectionProviderUserHelper(provider, selectionProvider);

            hasFocus = (bool)Provider.GetPropertyValue(
                AutomationElementIdentifiers.HasKeyboardFocusProperty.Id);
        }
Exemple #10
0
		public ComboBox (IRawElementProviderSimple provider) : base (provider)
		{
			if (!(provider is IRawElementProviderFragment))
				throw new ArgumentException ("Provider should be IRawElementProviderFragment");
			
			this.Role = Atk.Role.ComboBox;

			selProvider = (ISelectionProvider)provider.GetPatternProvider (SelectionPatternIdentifiers.Pattern.Id);
			
			if (selProvider == null)
				throw new ArgumentException ("ComboBoxProvider should always implement ISelectionProvider");
			
			selectionHelper = 
				new SelectionProviderUserHelper ((IRawElementProviderFragment)Provider, 
				                                 selProvider, true);
			
			var providersSelected = selProvider.GetSelection ();
			if (providersSelected != null && providersSelected.Length == 1)
				Name = (string)providersSelected [0].GetPropertyValue (AEIds.NameProperty.Id);
		}
Exemple #11
0
        public ComboBoxOptions(IRawElementProviderSimple provider) : base(provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if ((provider as IRawElementProviderFragment) == null)
            {
                throw new ArgumentException("Provider for ParentMenu should be IRawElementProviderFragment");
            }

            selectionProvider = (ISelectionProvider)provider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
            if (selectionProvider == null)
            {
                throw new ArgumentException("The List inside the ComboBox should always implement ISelectionProvider");
            }

            selectionHelper = new SelectionProviderUserHelper(provider as IRawElementProviderFragment, selectionProvider);

            Role = Atk.Role.Menu;
        }
Exemple #12
0
        public List(IRawElementProviderFragmentRoot provider) : base(provider)
        {
            this.provider = provider;

            selectionProvider = (ISelectionProvider)provider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
            if (selectionProvider == null)
            {
                throw new ArgumentException("List should always implement ISelectionProvider");
            }

            int controlTypeId = (int)Provider.GetPropertyValue(AutomationElementIdentifiers.ControlTypeProperty.Id);

            if (controlTypeId == ControlType.Spinner.Id)
            {
                Role = Atk.Role.SpinButton;
            }
            else
            {
                Role = Atk.Role.List;
            }

            selectionHelper = new SelectionProviderUserHelper(provider, selectionProvider);
        }
Exemple #13
0
		public Tree (IRawElementProviderFragment provider) : base (provider)
		{
			this.provider = provider;
			
			selectionProvider = (ISelectionProvider)provider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
			if (selectionProvider == null)
				throw new ArgumentException ("Tree should always implement ISelectionProvider");

			tableExpert = new TableImplementorHelper (this);

			Role = Atk.Role.TreeTable;
			
			selectionHelper = new SelectionProviderUserHelper (provider, selectionProvider);

			hasFocus = (bool) Provider.GetPropertyValue (
				AutomationElementIdentifiers.HasKeyboardFocusProperty.Id);
		}
Exemple #14
0
		public List (IRawElementProviderFragmentRoot provider) : base (provider)
		{
			this.provider = provider;
			
			selectionProvider = (ISelectionProvider)provider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id);
			if (selectionProvider == null)
				throw new ArgumentException ("List should always implement ISelectionProvider");

			int controlTypeId = (int) Provider.GetPropertyValue (AutomationElementIdentifiers.ControlTypeProperty.Id);
			if (controlTypeId == ControlType.Spinner.Id)
				Role = Atk.Role.SpinButton;
			else
				Role = Atk.Role.List;
			
			selectionHelper = new SelectionProviderUserHelper (provider, selectionProvider);
		}