public static T FindDescendantByProperty <T>(this GuiContextMenu ContextMenu, Func <T, bool> Property = null) where T : class { if (Property == null) { Property = new Func <T, bool>(t => true); } return(findDescendantByPropertyTemplate <T>(ContextMenu.Children, Property)); }
public static GuiContextMenu Select(this GuiContextMenu ContextMenu, string Menu) { if (ContextMenu.Children.Count > 0) { for (int i = 0; i < ContextMenu.Children.Count; i++) { GuiContextMenu subMenu = ContextMenu.Children.ElementAt(i) as GuiContextMenu; if (subMenu.Text.IndexOf(Menu, StringComparison.OrdinalIgnoreCase) >= 0) { subMenu.Select(); return(subMenu); } } } return(null); }
public static IEnumerable <T> FindAllByName <T>(this GuiContextMenu ContextMenu, string Name) where T : class { return(findAllByNameTemplate <T>(Name, ContextMenu.FindAllByName)); }
public static T FindById <T>(this GuiContextMenu ContextMenu, string Id) where T : class { return(findByIdTemplate <T>(Id, ContextMenu.FindById)); }
public static T FindByName <T>(this GuiContextMenu ContextMenu, string Name) where T : class { return(findByNameTemplate <T>(Name, ContextMenu.FindByName)); }
public static T FindChildByProperty <T>(this GuiContextMenu ContextMenu, Func <T, bool> Property = null) where T : class { return(findChildByPropertyTemplate <T>(ContextMenu.Children, Property)); }
public static T FindByNameEx <T>(this GuiContextMenu ContextMenu, string Name, int TypeId) where T : class { return(findByNameExTemplate <T>(Name, TypeId, ContextMenu.FindByNameEx)); }
public static IEnumerable <T> FindDescendantsByProperty <T>(this GuiContextMenu ContextMenu, Func <T, bool> Property = null) where T : class { return(findDescendantsByPropertyTemplate <T>(ContextMenu.Children, Property)); }