本文整理汇总了C#中System.Windows.Automation.Peers.AutomationPeer.IsDataItemAutomationPeer方法的典型用法代码示例。如果您正苦于以下问题:C# AutomationPeer.IsDataItemAutomationPeer方法的具体用法?C# AutomationPeer.IsDataItemAutomationPeer怎么用?C# AutomationPeer.IsDataItemAutomationPeer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Automation.Peers.AutomationPeer
的用法示例。
在下文中一共展示了AutomationPeer.IsDataItemAutomationPeer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StaticWrap
//------------------------------------------------------
//
// Internal Methods
//
//------------------------------------------------------
#region Internal Methods
// Wrap the found peer before shipping it over process boundary - static version for use outside ElementProxy.
internal static ElementProxy StaticWrap(AutomationPeer peer, AutomationPeer referencePeer)
{
ElementProxy result = null;
if (peer != null)
{
//referencePeer is well-connected, since UIA is asking us using it.
//However we are trying to return the peer that is possibly just created on some
//element in the middle of un-walked tree and we need to make sure it is fully
//"connected" or initialized before we return it to UIA.
//This method ensures it has the right _parent and other hookup.
peer = peer.ValidateConnected(referencePeer);
if (peer != null)
{
// Use the already created Wrapper proxy for peer if it is still alive
if(peer.ElementProxyWeakReference != null)
{
result = peer.ElementProxyWeakReference.Target as ElementProxy;
}
if(result == null)
{
result = new ElementProxy(peer);
peer.ElementProxyWeakReference = new WeakReference(result);
}
// If the peer corresponds to DataItem notify peer to add to storage to
// keep reference of peers going to the UIA Client
if(result != null)
{
if(peer.IsDataItemAutomationPeer())
{
peer.AddToParentProxyWeakRefCache();
}
}
}
}
return result;
}