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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }