public static T FindByViewId <T>(this ILayoutContainer root, string viewId) where T : LayoutContent { return(root?.Descendents() .OfType <T>() .FirstOrDefault(x => x.ContentId == viewId)); }
public static bool ContainsChildOfType <T, S>(this ILayoutContainer container) { foreach (var childElement in container.Descendents()) { if (childElement is T || childElement is S) { return(true); } } return(false); }
public static bool ContainsChildOfType <T>(this ILayoutContainer element) { foreach (var childElement in element.Descendents()) { if (childElement is T) { return(true); } } return(false); }
public static bool ContainsChildOfType <T>(this ILayoutContainer element) { bool flag; using (IEnumerator <ILayoutElement> enumerator = element.Descendents().GetEnumerator()) { while (enumerator.MoveNext()) { if (!(enumerator.Current is T)) { continue; } flag = true; return(flag); } return(false); } return(flag); }
public static bool ContainsChildOfType <T, S>(this ILayoutContainer container) { bool flag; using (IEnumerator <ILayoutElement> enumerator = container.Descendents().GetEnumerator()) { while (enumerator.MoveNext()) { ILayoutElement current = enumerator.Current; if (!(current is T) && !(current is S)) { continue; } flag = true; return(flag); } return(false); } return(flag); }
public static bool ContainsChildOfType <T, TS>(this ILayoutContainer container) { return(container.Descendents().Any(childElement => childElement is T || childElement is TS)); }
public static bool ContainsChildOfType <T>(this ILayoutContainer element) { return(element.Descendents().OfType <T>().Any()); }