Beispiel #1
0
        public void Execute(OnDeletingArgs <LayoutArea> args)
        {
            LayoutArea area = args.Item;

            if (area.Layout != null)
            {
                area.Layout.LayoutAreas.Remove(area); //required to clear cache
                args.Session.SaveOrUpdate(area.Layout);
            }
        }
Beispiel #2
0
        public void Execute(OnDeletingArgs <Layout> args)
        {
            Layout layout = args.Item;

            if (layout == null)
            {
                return;
            }
            foreach (PageTemplate pageTemplate in layout.PageTemplates)
            {
                pageTemplate.Layout = null;
            }
            layout.PageTemplates.Clear();
        }
Beispiel #3
0
        public void Execute(OnDeletingArgs <User> args)
        {
            User user = args.Item;

            if (user == null)
            {
                return;
            }

            foreach (UserRole userRole in user.Roles)
            {
                userRole.Users.Remove(user);
            }
            user.Roles.Clear();
        }
        public void Execute(OnDeletingArgs <MediaCategory> args)
        {
            MediaCategory category = args.Item;

            if (category == null)
            {
                return;
            }
            List <MediaFile> mediaFiles = category.Files.ToList();

            foreach (MediaFile mediaFile in mediaFiles)
            {
                _fileService.DeleteFile(mediaFile);
            }
            _fileService.RemoveFolder(category);
        }
Beispiel #5
0
        public void Execute(OnDeletingArgs <Widget> args)
        {
            Widget widget = args.Item;

            if (widget == null)
            {
                return;
            }

            widget.ShownOn.ForEach(webpage => webpage.ShownWidgets.Remove(widget));
            widget.HiddenOn.ForEach(webpage => webpage.HiddenWidgets.Remove(widget));
            if (widget.LayoutArea != null)
            {
                widget.LayoutArea.Widgets.Remove(widget); //required to clear cache
            }
            if (widget.Webpage != null)
            {
                widget.Webpage.Widgets.Remove(widget);
            }
        }
Beispiel #6
0
        public void Execute(OnDeletingArgs <PageWidgetSort> args)
        {
            PageWidgetSort sort = args.Item;

            if (sort == null)
            {
                return;
            }

            if (sort.LayoutArea.PageWidgetSorts.Contains(sort))
            {
                sort.LayoutArea.PageWidgetSorts.Remove(sort);
            }
            if (sort.Webpage.PageWidgetSorts.Contains(sort))
            {
                sort.Webpage.PageWidgetSorts.Remove(sort);
            }
            if (sort.Widget.PageWidgetSorts.Contains(sort))
            {
                sort.Widget.PageWidgetSorts.Remove(sort);
            }
        }