public override List<IUiElement> SearchForElements(SearcherTemplateData searchData)
{
#region search from the root
ResultCollection.AddRange(
UiElement.RootElement.FindAll(
classic.TreeScope.Children,
conditionsForContextMenuSearch).ToArray().ToList());
#endregion search from the root
#region search from the input
if (null == ResultCollection || 0 == ResultCollection.Count) {
ResultCollection.AddRange(
(searchData as ContextMenuSearcherData).InputObject.FindAll(
classic.TreeScope.Children,
conditionsForContextMenuSearch).ToArray().ToList());
}
#endregion search from the input
#region search from the window
if (null == ResultCollection || 0 == ResultCollection.Count) {
if (null != CurrentData.CurrentWindow) {
ResultCollection.AddRange(
CurrentData.CurrentWindow.FindAll(
classic.TreeScope.Children,
conditionsForContextMenuSearch).ToArray().ToList());
}
}
#endregion search from the window
return ResultCollection;
}