本文整理汇总了C#中System.Windows.Automation.Provider.IRawElementProviderSimple类的典型用法代码示例。如果您正苦于以下问题:C# IRawElementProviderSimple类的具体用法?C# IRawElementProviderSimple怎么用?C# IRawElementProviderSimple使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IRawElementProviderSimple类属于System.Windows.Automation.Provider命名空间,在下文中一共展示了IRawElementProviderSimple类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TreeItem
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);
}
示例2: ComponentAdapter
public ComponentAdapter (IRawElementProviderSimple provider) : base (provider)
{
if (provider == null)
throw new ArgumentNullException ("provider");
componentExpert = new ComponentImplementorHelper (this);
}
示例3: ExpandCollapseButton
public ExpandCollapseButton (IRawElementProviderSimple provider) : base (provider)
{
ec_prov = (IExpandCollapseProvider)provider.GetPatternProvider (
ExpandCollapsePatternIdentifiers.Pattern.Id);
Role = Atk.Role.ToggleButton;
}
示例4: RemoveAutomationPropertyChangedEventHandler
public static void RemoveAutomationPropertyChangedEventHandler (IRawElementProviderSimple provider, AutomationPropertyChangedEventHandler eventHandler)
{
lock (propertyChangedEventEntries)
propertyChangedEventEntries.RemoveAll (e =>
e.Provider == provider &&
e.Handler == eventHandler);
}
示例5: MenuItem
public MenuItem (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");
textExpert = TextImplementorFactory.GetImplementor (this, provider);
Role = Atk.Role.MenuItem;
string name = (string) provider.GetPropertyValue (AutomationElementIdentifiers.NameProperty.Id);
if (!String.IsNullOrEmpty (name))
Name = name;
invokeProvider = (IInvokeProvider)
provider.GetPatternProvider (InvokePatternIdentifiers.Pattern.Id);
toggleProvider = (IToggleProvider)
provider.GetPatternProvider (TogglePatternIdentifiers.Pattern.Id);
selectionItemProvider = (ISelectionItemProvider)
provider.GetPatternProvider (SelectionItemPatternIdentifiers.Pattern.Id);
expandCollapseProvider = (IExpandCollapseProvider)
provider.GetPatternProvider (ExpandCollapsePatternIdentifiers.Pattern.Id);
actionExpert.Add ("click", "click", null, DoClick);
}
示例6: Slider
public Slider (IRawElementProviderSimple provider) : base (provider)
{
Role = Atk.Role.Slider;
rangeValueProvider = (IRangeValueProvider)provider.GetPatternProvider (RangeValuePatternIdentifiers.Pattern.Id);
textExpert = TextImplementorFactory.GetImplementor (this, provider);
oldText = textExpert.Text;
}
示例7: SimpleTreeItem
public SimpleTreeItem (IRawElementProviderSimple provider) : base (provider)
{
actionExpert.Clear ();
actionExpert.Add (EXPAND_OR_CONTRACT_ACTION_NAME,
EXPAND_OR_CONTRACT_ACTION_NAME,
EXPAND_OR_CONTRACT_ACTION_DESC,
DoInvoke);
}
示例8: AddStructureChangedEventHandler
public static void AddStructureChangedEventHandler (
IRawElementProviderSimple provider, TreeScope scope,
StructureChangedEventHandler eventHandler)
{
var entry = new StructureChangedEventEntry (provider, scope, eventHandler);
lock (structureChangedEventEntries)
structureChangedEventEntries.Add (entry);
}
示例9: AddAutomationEventHandler
public static void AddAutomationEventHandler (AutomationEvent eventId,
IRawElementProviderSimple provider, TreeScope scope,
AutomationEventHandler eventHandler)
{
var entry = new AutomationEventEntry (eventId, provider, scope, eventHandler);
lock (automationEventEntries)
automationEventEntries.Add (entry);
}
示例10: RemoveAutomationEventHandler
public static void RemoveAutomationEventHandler (AutomationEvent eventId, IRawElementProviderSimple provider, AutomationEventHandler eventHandler)
{
lock (automationEventEntries)
automationEventEntries.RemoveAll (e =>
e.EventId == eventId &&
e.Provider == provider &&
e.Handler == eventHandler);
}
示例11: ComboBoxDropDown
public ComboBoxDropDown (IRawElementProviderSimple provider) : base (provider)
{
this.provider = provider as IRawElementProviderFragmentRoot;
if (this.provider == null)
throw new ArgumentException ("Provider should be IRawElementProviderFragmentRoot");
expandCollapseProvider = (IExpandCollapseProvider)provider.GetPatternProvider (ExpandCollapsePatternIdentifiers.Pattern.Id);
}
示例12: CheckBoxButton
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;
}
示例13: RangeFromChild
public ITextRangeProvider RangeFromChild(IRawElementProviderSimple childElement)
{
if (!(childElement is ElementProxy))
{
throw new ArgumentException(SR.Get(SRID.TextProvider_InvalidChild, "childElement"));
}
return (ITextRangeProvider)ElementUtil.Invoke(_peer, new DispatcherOperationCallback(RangeFromChild), childElement);
}
示例14: TabPage
public TabPage (IRawElementProviderSimple provider): base (provider)
{
Role = Atk.Role.PageTab;
selectionItemProvider = (ISelectionItemProvider)provider.GetPatternProvider (
SelectionItemPatternIdentifiers.Pattern.Id);
if (selectionItemProvider == null)
throw new ArgumentException (
"Provider for TabPage should implement ISelectionItemProvider");
}
示例15: AddAutomationPropertyChangedEventHandler
public static void AddAutomationPropertyChangedEventHandler (
IRawElementProviderSimple provider, TreeScope scope,
AutomationPropertyChangedEventHandler eventHandler,
int [] properties)
{
var entry = new PropertyChangedEventEntry (provider, scope, properties, eventHandler);
lock (propertyChangedEventEntries)
propertyChangedEventEntries.Add (entry);
}