コード例 #1
0
ファイル: ListItem.cs プロジェクト: ABEMBARKA/monoUI
        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
ファイル: TreeItem.cs プロジェクト: ABEMBARKA/monoUI
        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
ファイル: TreeItem.cs プロジェクト: mono/uia2atk
		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
        public TextBoxEntryView(IRawElementProviderSimple provider) : base(provider)
        {
            if (IsTableCell)
            {
                Role = Atk.Role.TableCell;
            }
            else
            {
                Role = Atk.Role.Text;
            }

            if (provider.GetPatternProvider(TextPatternIdentifiers.Pattern.Id) == null &&
                provider.GetPatternProvider(ValuePatternIdentifiers.Pattern.Id) == null)
            {
                throw new ArgumentException("Provider for TextBox should either implement IValue or IText");
            }

            textExpert = TextImplementorFactory.GetImplementor(this, provider);
            if ((int)provider.GetPropertyValue(AutomationElementIdentifiers.ControlTypeProperty.Id)
                == ControlType.Document.Id)
            {
                multiLine = true;
            }

            editableTextExpert = new EditableTextImplementorHelper(this, this, textExpert);
        }
コード例 #5
0
ファイル: List.cs プロジェクト: ABEMBARKA/monoUI
        public ListWithEditableText(IRawElementProviderFragmentRoot provider)
            : base(provider)
        {
            IValueProvider value_prov
                = provider.GetPatternProvider(ValuePatternIdentifiers.Pattern.Id) as IValueProvider;

            if (value_prov == null)
            {
                throw new ArgumentException("Provider does not implement IValue");
            }

            text_helper        = TextImplementorFactory.GetImplementor(this, provider);
            editableTextExpert = new EditableTextImplementorHelper(this, this, text_helper);
        }
コード例 #6
0
ファイル: TextBoxEntryView.cs プロジェクト: mono/uia2atk
		public TextBoxEntryView (IRawElementProviderSimple provider) : base (provider)
		{
			if (IsTableCell)
				Role = Atk.Role.TableCell;
			else
				Role = Atk.Role.Text;

			if (provider.GetPatternProvider (TextPatternIdentifiers.Pattern.Id) == null
			    && provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id) == null)
				throw new ArgumentException ("Provider for TextBox should either implement IValue or IText");
			
			textExpert = TextImplementorFactory.GetImplementor (this, provider);
			if ((int) provider.GetPropertyValue (AutomationElementIdentifiers.ControlTypeProperty.Id) 
			    == ControlType.Document.Id)
				multiLine = true;

			editableTextExpert = new EditableTextImplementorHelper (this, this, textExpert);
		}
コード例 #7
0
ファイル: ListItem.cs プロジェクト: mono/uia2atk
		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);
		}
コード例 #8
0
ファイル: List.cs プロジェクト: mono/uia2atk
		public ListWithEditableText (IRawElementProviderFragmentRoot provider)
			: base (provider)
		{
			IValueProvider value_prov
				= provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id) as IValueProvider;
			if (value_prov == null) {
				throw new ArgumentException ("Provider does not implement IValue");
			}

			text_helper = TextImplementorFactory.GetImplementor (this, provider);
			editableTextExpert = new EditableTextImplementorHelper (this, this, text_helper);
		}