static IEnumerable <IClickableMenu> GetAncestors(IClickableMenu menu) { for (; menu != null; menu = menu.GetParentMenu()) { yield return(menu); } }