示例#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
文件: 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
		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);
		}