private static IEnumerable <MetaTBManifest.DesignType> FlattenDesignType(MetaTBManifest.DesignType e) { if (e.Type != "Component") { return((new[] { e }).Concat(e.Children.SelectMany(c => FlattenDesignType(c)))); } return(new[] { e }); }
private static bool DesignTypeIsSelected(MetaTBManifest.DesignType e) { if (e.Selected == true) { return(true); } if (e.Children != null) { foreach (var child in e.Children) { if (DesignTypeIsSelected(child)) { return(true); } } } return(false); }