Esempio n. 1
0
        protected void SetTemplateDefaultSelector(int TemplateID, ContentTypeAndDemoSelector Selector)
        {
            var itemType = Selector.ItemType;
            var template = App.TemplateManager.GetTemplate(TemplateID);

            if (itemType == "Content")
            {
                Selector.ContentTypeStaticName = template.ContentTypeStaticName;
                Selector.DemoEntityID          = template.ContentDemoEntity != null ? template.ContentDemoEntity.EntityId : new int?();
            }

            if (itemType == "Presentation")
            {
                Selector.ContentTypeStaticName = template.PresentationTypeStaticName;
                Selector.DemoEntityID          = template.PresentationDemoEntity != null ? template.PresentationDemoEntity.EntityId : new int?();
            }

            if (itemType == "ListContent")
            {
                Selector.ContentTypeStaticName = template.ListContentTypeStaticName;
                Selector.DemoEntityID          = template.ListContentDemoEntity != null ? template.ListContentDemoEntity.EntityId : new int?();
            }

            if (itemType == "ListPresentation")
            {
                Selector.ContentTypeStaticName = template.ListPresentationTypeStaticName;
                Selector.DemoEntityID          = template.ListPresentationDemoEntity != null ? template.ListPresentationDemoEntity.EntityId : new int?();
            }

            Selector.Enabled = !App.ContentGroupManager.IsConfigurationInUse(TemplateID, itemType);
        }
Esempio n. 2
0
        protected void SetTemplateDefaultSelector(int TemplateID, ContentTypeAndDemoSelector Selector)
        {
            var ItemType        = Selector.ItemType;
            var TemplateDefault = Sexy.GetTemplateDefault(TemplateID, ItemType);

            if (TemplateDefault != null)
            {
                Selector.ContentTypeID = TemplateDefault.ContentTypeID;
                Selector.DemoEntityID  = TemplateDefault.DemoEntityID;
            }

            Selector.ItemType = ItemType;
            Selector.Enabled  = !Sexy.IsTemplateDefaultInUse(TemplateID, ItemType);
        }
Esempio n. 3
0
        protected void SetTemplateDefaultSelector(int TemplateID, ContentTypeAndDemoSelector Selector)
        {
            var itemType = Selector.ItemType;
            var template = Sexy.Templates.GetTemplate(TemplateID);

            if (itemType == "Content")
            {
                Selector.ContentTypeStaticName = template.ContentTypeStaticName;
                Selector.DemoEntityID = template.ContentDemoEntity != null ? template.ContentDemoEntity.EntityId : new int?();
            }

            if (itemType == "Presentation")
            {
                Selector.ContentTypeStaticName = template.PresentationTypeStaticName;
                Selector.DemoEntityID = template.PresentationDemoEntity != null ? template.PresentationDemoEntity.EntityId : new int?();
            }

            if (itemType == "ListContent")
            {
                Selector.ContentTypeStaticName = template.ListContentTypeStaticName;
                Selector.DemoEntityID = template.ListContentDemoEntity != null ? template.ListContentDemoEntity.EntityId : new int?();
            }

            if (itemType == "ListPresentation")
            {
                Selector.ContentTypeStaticName = template.ListPresentationTypeStaticName;
                Selector.DemoEntityID = template.ListPresentationDemoEntity != null ? template.ListPresentationDemoEntity.EntityId : new int?();
            }

            Selector.Enabled = !Sexy.ContentGroups.IsConfigurationInUse(TemplateID, itemType);
        }