Beispiel #1
0
        public override IComponent CreateComponent()
        {
            var container = new ComponentGroup("Content");
            container.ContainerType = ContainerType.System;

            foreach (var slice in _slices.OrderByDescending(x => x.Order))
            {
                var listComponent = new ContentSliceComponent
                    {
                        Heading = slice.Name
                    };
                listComponent.Settings["queryName"] = slice.Name;
                listComponent.Settings["heading"] = slice.Name;
                listComponent.Settings["createOptions"] = slice.CreateOptions;
                var sortableSlice = slice as ISortableContentSlice;
                if (sortableSlice != null)
                {
                    listComponent.Settings["sortOptions"] = sortableSlice.SortOptions;
                    listComponent.Settings["defaultSortOption"] = sortableSlice.DefaultSortOption;
                    listComponent.Settings["hideSortOptions"] = sortableSlice.HideSortOptions;
                }
                container.Add(listComponent);
            }

            return container;
        }
        public override IComponent CreateComponent()
        {
            var container = new ComponentGroup("Content");

            container.ContainerType = ContainerType.System;

            foreach (var slice in _slices.OrderByDescending(x => x.Order))
            {
                var listComponent = new ContentSliceComponent
                {
                    Heading = slice.Name
                };
                listComponent.Settings["queryName"]     = slice.Name;
                listComponent.Settings["heading"]       = slice.Name;
                listComponent.Settings["createOptions"] = slice.CreateOptions;
                var sortableSlice = slice as ISortableContentSlice;
                if (sortableSlice != null)
                {
                    listComponent.Settings["sortOptions"]       = sortableSlice.SortOptions;
                    listComponent.Settings["defaultSortOption"] = sortableSlice.DefaultSortOption;
                    listComponent.Settings["hideSortOptions"]   = sortableSlice.HideSortOptions;
                }
                container.Add(listComponent);
            }

            return(container);
        }