Ejemplo n.º 1
0
 protected static IEnumerable <Kn5RenderableDepthOnlyObject> Flatten(RenderableList root, Func <IRenderableObject, bool> filter = null)
 {
     return(root
            .SelectManyRecursive(x => {
         var list = x as Kn5RenderableList;
         if (list == null || !list.IsEnabled)
         {
             return null;
         }
         return filter?.Invoke(list) == false ? null : list;
     })
            .OfType <Kn5RenderableDepthOnlyObject>()
            .Where(x => x.IsEnabled && filter?.Invoke(x) != false));
 }