예제 #1
0
        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;
                }
            }
        }
예제 #2
0
        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;
                }
            }
        }