本文整理汇总了C#中System.Windows.Automation.Peers.AutomationPeer类的典型用法代码示例。如果您正苦于以下问题:C# AutomationPeer类的具体用法?C# AutomationPeer怎么用?C# AutomationPeer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AutomationPeer类属于System.Windows.Automation.Peers命名空间,在下文中一共展示了AutomationPeer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Calendar
public Calendar (Adapter adapter, AutomationPeer peer)
: base (adapter, peer)
{
FrameworkElementAutomationPeer feap = peer as FrameworkElementAutomationPeer;
if (feap == null)
return;
// XXX: We can't link to System.Windows.Controls, so
// we'll use reflection instead.
UIElement calendar = feap.Owner;
Type t = calendar.GetType ();
if (t.Namespace != "System.Windows.Controls" || t.Name != "Calendar")
return;
// XXX SUCH A HACK! XXX
// Workaround a bug in CalendarAutomationPeer.
// Even though its selection and NameProperty
// change, it does not send the proper change
// notifications via the peer. So we fake them.
EventInfo ei = t.GetEvent ("SelectedDatesChanged");
ei.AddEventHandler (calendar,
new EventHandler<SelectionChangedEventArgs> (OnSelectedDatesChanged));
}
开发者ID:mono,项目名称:uia2atk,代码行数:25,代码来源:Calendar.cs
示例2: BaseActionImplementor
public BaseActionImplementor (Adapter adapter, AutomationPeer peer)
: base (adapter, peer)
{
// TODO: also do this in response to patterns being
// added/removed
RefreshActions ();
}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:BaseActionImplementor.cs
示例3: ExpandCollapseInvokeToggle
public ExpandCollapseInvokeToggle (Adapter adapter, AutomationPeer peer)
: base (adapter, peer)
{
adapter.AutomationPropertyChanged
+= new EventHandler<AutomationPropertyChangedEventArgs> (
OnAutomationPropertyChanged);
}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:ExpandCollapseInvokeToggle.cs
示例4: RaisePropertyChangedEvent
public void RaisePropertyChangedEvent (AutomationPeer peer,
AutomationProperty property,
object oldValue,
object newValue)
{
if (!AccessibilityEnabled || peer == null)
return;
if (object.Equals (newValue, oldValue))
return;
// We are going to raise changes only when the value ACTUALLY CHANGES
IAutomationCacheProperty cachedProperty = peer.GetCachedProperty (property);
if (cachedProperty != null) {
if (object.Equals (newValue, cachedProperty.OldValue))
return;
cachedProperty.OldValue = newValue;
}
if (AutomationPropertyChanged != null)
AutomationPropertyChanged (this,
new AutomationPropertyChangedEventArgs (peer,
property,
oldValue,
newValue));
}
开发者ID:dfr0,项目名称:moon,代码行数:26,代码来源:AutomationSingleton.cs
示例5: RadioButton
public RadioButton (Adapter adapter, AutomationPeer peer)
: base (adapter, peer)
{
adapter.AutomationPropertyChanged
+= new EventHandler<AutomationPropertyChangedEventArgs> (
OnAutomationPropertyChanged);
}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:RadioButton.cs
示例6: GridTable
public GridTable (Adapter adapter, AutomationPeer peer) : base (adapter, peer)
{
this.peer = peer;
this.tableProvider = (ITableProvider) peer.GetPattern (
PatternInterface.Table);
}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:GridTable.cs
示例7: CategoryContainerAutomationPeer
// Private ctor called from two public, static accessors
private CategoryContainerAutomationPeer(CiderCategoryContainer container, AutomationPeer itemPeer)
{
Fx.Assert(container != null, "CategoryContainer not specified.");
Fx.Assert(itemPeer != null, "CategoryContainerItemAutomationPeer not specified.");
_container = container;
_itemAutomationPeer = itemPeer;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:9,代码来源:CategoryContainerAutomationPeer.cs
示例8: RaiseAutomationEvent
public void RaiseAutomationEvent (AutomationPeer peer, AutomationEvents eventId)
{
if (!AccessibilityEnabled || peer == null)
return;
if (AutomationEventRaised != null)
AutomationEventRaised (this, new AutomationEventEventArgs (peer, eventId));
}
开发者ID:dfr0,项目名称:moon,代码行数:8,代码来源:AutomationSingleton.cs
示例9: Selection
public Selection (Adapter adapter, AutomationPeer peer) : base (adapter, peer)
{
this.selectionProvider = (ISelectionProvider) peer.GetPattern (
PatternInterface.Selection);
adapter.AutomationPropertyChanged += (o, args) => {
if (args.Property == SelectionPatternIdentifiers.SelectionProperty)
adapter.EmitSignal ("selection_changed");
};
}
开发者ID:mono,项目名称:uia2atk,代码行数:10,代码来源:Selection.cs
示例10: RangeValue
public RangeValue (Adapter adapter, AutomationPeer peer)
: base (adapter, peer)
{
this.rangeValueProvider = (IRangeValueProvider) peer.GetPattern (
PatternInterface.RangeValue);
adapter.AutomationPropertyChanged
+= new EventHandler<AutomationPropertyChangedEventArgs> (
OnAutomationPropertyChanged);
}
开发者ID:mono,项目名称:uia2atk,代码行数:10,代码来源:RangeValue.cs
示例11: TextAdaptor
//-------------------------------------------------------------------
//
// Constructors
//
//-------------------------------------------------------------------
#region Constructors
/// <summary>
/// Constructor
/// </summary>
/// <param name="textPeer">Automation Peer representing element for the ui scope of the text</param>
/// <param name="textContainer">ITextContainer</param>
internal TextAdaptor(AutomationPeer textPeer, ITextContainer textContainer)
{
Invariant.Assert(textContainer != null, "Invalid ITextContainer");
Invariant.Assert(textPeer is TextAutomationPeer || textPeer is ContentTextAutomationPeer, "Invalid AutomationPeer");
_textPeer = textPeer;
_textContainer = textContainer;
_textContainer.Changed += new TextContainerChangedEventHandler(OnTextContainerChanged);
if (_textContainer.TextSelection != null)
{
_textContainer.TextSelection.Changed += new EventHandler(OnTextSelectionChanged);
}
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:25,代码来源:TextAdaptor.cs
示例12: GetSupportedPropertyValueInternal
internal static new object GetSupportedPropertyValueInternal(AutomationPeer itemPeer, int propertyId)
{
if (SelectionItemPatternIdentifiers.IsSelectedProperty.Id == propertyId)
{
ISelectionItemProvider selectionItem = itemPeer.GetPattern(PatternInterface.SelectionItem) as ISelectionItemProvider;
if (selectionItem != null)
return selectionItem.IsSelected;
else
return null;
}
return ItemsControlAutomationPeer.GetSupportedPropertyValueInternal(itemPeer, propertyId);
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:12,代码来源:SelectorAutomationPeer.cs
示例13: ElementProxy
//------------------------------------------------------
//
// Constructors
//
//------------------------------------------------------
#region Constructors
// private ctor - the Wrap() pseudo-ctor is used instead.
private ElementProxy(AutomationPeer peer)
{
if ((AutomationInteropReferenceType == ReferenceType.Weak) &&
(peer is UIElementAutomationPeer || peer is ContentElementAutomationPeer || peer is UIElement3DAutomationPeer))
{
_peer = new WeakReference(peer);
}
else
{
_peer = peer;
}
}
开发者ID:JianwenSun,项目名称:cc,代码行数:21,代码来源:ElementProxy.cs
示例14: InteropAutomationProvider
internal InteropAutomationProvider(HostedWindowWrapper wrapper, AutomationPeer parent)
{
if (wrapper == null)
{
throw new ArgumentNullException("wrapper");
}
if (parent == null)
{
throw new ArgumentNullException("parent");
}
_wrapper = wrapper;
_parent = parent;
}
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:14,代码来源:InteropAutomationProvider.cs
示例15: SelectionItem
public SelectionItem (Adapter adapter, AutomationPeer peer) : base (adapter, peer)
{
bool? isSelected = IsSelected;
if (isSelected.HasValue)
WasSelected = isSelected.Value;
adapter.AutomationPropertyChanged
+= new EventHandler<AutomationPropertyChangedEventArgs> (
OnAutomationPropertyChanged);
adapter.AutomationEventRaised
+= new EventHandler<AutomationEventEventArgs> (
OnAutomationEventRaised);
}
开发者ID:mono,项目名称:uia2atk,代码行数:14,代码来源:SelectionItem.cs
示例16: DataGridItemAutomationPeer
/// <summary>
/// AutomationPeer for an item in a DataGrid
/// </summary>
public DataGridItemAutomationPeer(object item, DataGrid dataGrid)
: base()
{
if (item == null)
{
throw new ArgumentNullException("item");
}
if (dataGrid == null)
{
throw new ArgumentNullException("dataGrid");
}
_item = item;
_dataGridAutomationPeer = FrameworkElementAutomationPeer.CreatePeerForElement(dataGrid);
}
开发者ID:merlin2504,项目名称:RD12,代码行数:19,代码来源:DataGridItemAutomationPeer.cs
示例17: TryInvokePatternAutomation
private static bool TryInvokePatternAutomation(AutomationPeer peer)
{
var pattern = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;
if (pattern == null)
return false;
try
{
pattern.Invoke();
}
catch (Exception exception)
{
throw new TestAutomationException("Exception while invoking pattern", exception);
}
return true;
}
开发者ID:giozom,项目名称:WindowsPhoneTestFramework,代码行数:17,代码来源:InvokeControlTapActionCommand.cs
示例18: DataGridGroupItemAutomationPeer
/// <summary>
/// AutomationPeer for a group of items in a DataGrid
/// </summary>
public DataGridGroupItemAutomationPeer(CollectionViewGroup group, DataGrid dataGrid)
: base(dataGrid)
{
if (group == null)
{
//
throw new ElementNotAvailableException();
}
if (dataGrid == null)
{
//
throw new ElementNotAvailableException();
}
_group = group;
_dataGridAutomationPeer = FrameworkElementAutomationPeer.CreatePeerForElement(dataGrid);
}
开发者ID:expanz,项目名称:expanz-Microsoft-XAML-SDKs,代码行数:22,代码来源:DataGridGroupItemAutomationPeer.cs
示例19: DataGridItemAutomationPeer
/// <summary>
/// AutomationPeer for an item in a DataGrid
/// </summary>
public DataGridItemAutomationPeer(object item, DataGrid dataGrid)
: base(dataGrid)
{
if (item == null)
{
//
throw new ElementNotAvailableException();
}
if (dataGrid == null)
{
//
throw new ElementNotAvailableException();
}
_item = item;
_dataGridAutomationPeer = FrameworkElementAutomationPeer.CreatePeerForElement(dataGrid);
}
开发者ID:dfr0,项目名称:moon,代码行数:22,代码来源:DataGridItemAutomationPeer.cs
示例20: RaiseAsyncContentLoadedEvent
internal static void RaiseAsyncContentLoadedEvent(AutomationPeer peer, long bytesRead, long maxBytes)
{
double percentComplete = 0d;
AsyncContentLoadedState asyncContentState = AsyncContentLoadedState.Beginning;
if (bytesRead > 0)
{
if (bytesRead < maxBytes)
{
percentComplete = maxBytes > 0 ? (bytesRead * 100d / maxBytes) : 0;
asyncContentState = AsyncContentLoadedState.Progress;
}
else
{
percentComplete = 100d;
asyncContentState = AsyncContentLoadedState.Completed;
}
}
peer.RaiseAsyncContentLoadedEvent(new AsyncContentLoadedEventArgs(asyncContentState, percentComplete));
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:21,代码来源:NavigationWindowAutomationPeer.cs
注:本文中的System.Windows.Automation.Peers.AutomationPeer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论