示例#1
0
 public WidgetCollection FindByName(params string[] names)
 {
     return(WidgetCollection.From(names.Select(n =>
                                               IncludeChildren()
                                               .FirstOrDefault(w => w.Name() == n))
                                  .Where(w => w != null)));
 }
示例#2
0
 public WidgetCollection Children(Func <Widget, bool> predicate)
 {
     return(WidgetCollection.From(Children().Where(predicate)));
 }
示例#3
0
        public WidgetCollection Children()
        {
            var i = Item as UIItemContainer;

            return(WidgetCollection.From(i == null ? Enumerable.Empty <IUIItem>() : i.Items));
        }
示例#4
0
 public WidgetCollection Windows()
 {
     return(WidgetCollection.From(Desktop.Instance.Windows()));
 }
示例#5
0
 public WidgetCollection Filter(Func <Widget, bool> predicate)
 {
     return(WidgetCollection.From(Widgets.Where(predicate)));
 }
示例#6
0
 public WidgetCollection Children()
 {
     return(WidgetCollection.From(Widgets.SelectMany(w => w.Children().Widgets)));
 }
示例#7
0
 public WidgetCollection IncludeChildren()
 {
     return(WidgetCollection.From(Widgets.SelectMany(w => w.Children().Widgets).Concat(Widgets).Distinct()));
 }