private void CreateMenuItem(Site site, string category, ref IDictionary <string, MenuItem> items) { if (!string.IsNullOrEmpty(category)) { string parentName = ""; foreach (var name in category.Split('.')) { var fullName = string.IsNullOrEmpty(parentName) ? name : string.Join(".", parentName, name); if (!items.ContainsKey(fullName)) { var item = new LabelMenuItem(name, fullName, ""); //CreateCultureItems(site, name, fullName, item); if (!string.IsNullOrEmpty(parentName)) { var parent = items[parentName]; ((IList <MenuItem>)parent.Items).Add(item); } items.Add(fullName, item); } parentName = fullName; } } }
private void CreateMenuItem(Site site, string category, ref IDictionary<string, MenuItem> items) { if (!string.IsNullOrEmpty(category)) { string parentName = ""; foreach (var name in category.Split('.')) { var fullName = string.IsNullOrEmpty(parentName) ? name : string.Join(".", parentName, name); if (!items.ContainsKey(fullName)) { var item = new LabelMenuItem(name, fullName, ""); //CreateCultureItems(site, name, fullName, item); if (!string.IsNullOrEmpty(parentName)) { var parent = items[parentName]; ((IList<MenuItem>)parent.Items).Add(item); } items.Add(fullName, item); } parentName = fullName; } } }