public WidgetCollection FindByName(params string[] names) { return(WidgetCollection.From(names.Select(n => IncludeChildren() .FirstOrDefault(w => w.Name() == n)) .Where(w => w != null))); }
public WidgetCollection Children(Func <Widget, bool> predicate) { return(WidgetCollection.From(Children().Where(predicate))); }
public WidgetCollection Children() { var i = Item as UIItemContainer; return(WidgetCollection.From(i == null ? Enumerable.Empty <IUIItem>() : i.Items)); }
public WidgetCollection Windows() { return(WidgetCollection.From(Desktop.Instance.Windows())); }
public WidgetCollection Filter(Func <Widget, bool> predicate) { return(WidgetCollection.From(Widgets.Where(predicate))); }
public WidgetCollection Children() { return(WidgetCollection.From(Widgets.SelectMany(w => w.Children().Widgets))); }
public WidgetCollection IncludeChildren() { return(WidgetCollection.From(Widgets.SelectMany(w => w.Children().Widgets).Concat(Widgets).Distinct())); }