protected virtual MenuItem CreateFolderMenuItem(T folder) { MenuItem menuItem = new FolderMenuItem(folder.AsActual()); var childFolders = FolderManager.ChildFolders(folder); List <MenuItem> items = new List <MenuItem>(); menuItem.Items = items; foreach (var child in childFolders) { items.Add(CreateFolderMenuItem(child)); } return(menuItem); }
protected virtual MenuItem CreateFolderMenuItem(T folder) { folder = folder.AsActual(); if (folder != null) { MenuItem menuItem = new FolderMenuItem(folder.AsActual()); var childFolders = FolderManager.ChildFolders(folder).OrderBy(it => it.FriendlyText).ToArray(); List <MenuItem> items = new List <MenuItem>(); menuItem.Items = items; foreach (var child in childFolders) { items.Add(CreateFolderMenuItem(child)); } return(menuItem); } return(null); }