static IEnumerable <CatalogSubject> Descendents(CatalogSubject parent, SystemUri.SchemeSegment scheme) { foreach (var childType in parent.GetType().GetNestedTypes()) { var child = (CatalogSubject)Activator.CreateInstance(childType, parent); yield return(child); foreach (var grandchild in Descendents(child, scheme)) { yield return(grandchild); } } }
public D UncShare(N n, CatalogSubject subject) => new D(new D(n, GetUncRoot(n), GetNodeDriveLetter(n)), subject.RelativeLocation);
public IEnumerable <CatalogSubject> Children(CatalogSubject parent) => CatalogState.FindDescendents(parent);
public IEnumerable <CatalogSubject> FindDescendents(CatalogSubject parent) => SubjectsByType.Values.Where(subect => object.ReferenceEquals(subect.Parent, parent));