System.Windows.Automation.SourceManager.GetOrCreateAutomationElement C# (CSharp) Method

GetOrCreateAutomationElement() static private method

static private GetOrCreateAutomationElement ( IElement sourceElement ) : AutomationElement
sourceElement IElement
return AutomationElement
		internal static AutomationElement GetOrCreateAutomationElement (IElement sourceElement)
		{
			if (sourceElement == null)
				return null;
			return new AutomationElement (sourceElement);
		}

Usage Example

示例#1
0
            private AutomationElement GetNextDirectSibling(AutomationElement element)
            {
                AutomationElement parent      = TreeWalker.RawViewWalker.GetParent(element);
                AutomationElement nextSibling = null;

                if (parent == AutomationElement.RootElement)
                {
                    lock (TreeWalker.RawViewWalker.directChildrenLock) {
                        int nextIndex = TreeWalker.RawViewWalker.directChildren.IndexOf(element) + 1;
                        if (nextIndex > -1 && nextIndex < TreeWalker.RawViewWalker.directChildren.Count)
                        {
                            nextSibling = TreeWalker.RawViewWalker.directChildren [nextIndex];
                        }
                        else
                        {
                            nextSibling = null;
                        }
                    }
                }
                else
                {
                    nextSibling = SourceManager.GetOrCreateAutomationElement(element.SourceElement.NextSibling);
                }

                return(nextSibling);
            }
All Usage Examples Of System.Windows.Automation.SourceManager::GetOrCreateAutomationElement