private void ExtendBackendDefinition(IContentViewControlDefinition contentViewControlDefinition, string backendViewName, FieldDisplayMode displayMode)
        {
            var backendEditViewDefinition = contentViewControlDefinition.Views.FirstOrDefault(v => v.ViewName == backendViewName) as DetailFormViewDefinition;

            if (backendEditViewDefinition != null)
            {
                ContentViewSectionDefinition advancedSection = backendEditViewDefinition.Sections.FirstOrDefault(s => s.Name == FormsDefinitionsExtender.AdvancedSectionName) as ContentViewSectionDefinition;
                if (advancedSection != null && SystemManager.GetApplicationModule(advancedSection.ModuleName) != null)
                {
                    var fieldDefinition = this.BuildFrameworkChoiceFieldDefinition(displayMode);
                    ((IList<IFieldDefinition>)advancedSection.Fields).Add(fieldDefinition);
                }
                else
                {
                    advancedSection = new ContentViewSectionDefinition()
                    {
                        CssClass = "sfExpandableForm",
                        DisplayMode = FieldDisplayMode.Write,
                        IsHiddenInTranslationMode = false,
                        ModuleName = "Feather",
                        Name = Guid.NewGuid().ToString(),
                        ResourceClassId = typeof(Labels).Name,
                        Title = "Advanced",
                        WrapperTag = HtmlTextWriterTag.Div
                    };

                    backendEditViewDefinition.Sections.Add(advancedSection);

                    var fieldDefinition = this.BuildFrameworkChoiceFieldDefinition(displayMode);
                    ((IList<IFieldDefinition>)advancedSection.Fields).Add(fieldDefinition);
                }
            }
        }
Пример #2
0
        private void ExtendBackendDefinition(IContentViewControlDefinition contentViewControlDefinition, string backendViewName, FieldDisplayMode displayMode, bool isHidden)
        {
            var backendEditViewDefinition = contentViewControlDefinition.Views.FirstOrDefault(v => v.ViewName == backendViewName) as DetailFormViewDefinition;

            if (backendEditViewDefinition != null)
            {
                ContentViewSectionDefinition advancedSection = backendEditViewDefinition.Sections.FirstOrDefault(s => s.Name == FormsDefinitionsExtender.AdvancedSectionName) as ContentViewSectionDefinition;
                if (advancedSection != null && SystemManager.GetApplicationModule(advancedSection.ModuleName) != null)
                {
                    var fieldDefinition = this.BuildFrameworkChoiceFieldDefinition(displayMode, isHidden);
                    ((IList <IFieldDefinition>)advancedSection.Fields).Add(fieldDefinition);
                }
                else
                {
                    advancedSection = new ContentViewSectionDefinition()
                    {
                        CssClass    = "sfExpandableForm",
                        DisplayMode = FieldDisplayMode.Write,
                        IsHiddenInTranslationMode = false,
                        ModuleName      = "Feather",
                        Name            = Guid.NewGuid().ToString(),
                        ResourceClassId = typeof(Labels).Name,
                        Title           = "Advanced",
                        WrapperTag      = HtmlTextWriterTag.Div
                    };

                    backendEditViewDefinition.Sections.Add(advancedSection);

                    var fieldDefinition = this.BuildFrameworkChoiceFieldDefinition(displayMode, false);
                    ((IList <IFieldDefinition>)advancedSection.Fields).Add(fieldDefinition);
                }
            }
        }
Пример #3
0
        public void ExtendDefinition(IContentViewControlDefinition contentViewControlDefinition)
        {
            var isHidden = SystemManager.GetModule("Feather") == null;

            this.ExtendBackendDefinition(contentViewControlDefinition, FormsBackendInsertViewName, FieldDisplayMode.Write, isHidden);
            this.ExtendBackendDefinition(contentViewControlDefinition, FormsBackendEditViewName, FieldDisplayMode.Read, isHidden);
            this.ExtendBackendDefinition(contentViewControlDefinition, FormsBackendDuplicateViewName, FieldDisplayMode.Read, isHidden);
        }
        private void ExtendBackendDefinition(IContentViewControlDefinition contentViewControlDefinition, string backendViewName, FieldDisplayMode displayMode)
        {
            var backendEditViewDefinition = contentViewControlDefinition.Views.FirstOrDefault(v => v.ViewName == backendViewName) as IDetailFormViewDefinition;

            if (backendEditViewDefinition != null)
            {
                var advancedSection = backendEditViewDefinition.Sections.FirstOrDefault(s => s.Name == FormsDefinitionsExtender.AdvancedSectionName);
                if (advancedSection != null)
                {
                    var fieldDefinition = this.BuildFrameworkChoiceFieldDefinition(displayMode);
                    ((IList<IFieldDefinition>)advancedSection.Fields).Add(fieldDefinition);
                }
            }
        }
        private void ExtendBackendDefinition(IContentViewControlDefinition contentViewControlDefinition, string backendViewName, FieldDisplayMode displayMode)
        {
            var backendEditViewDefinition = contentViewControlDefinition.Views.FirstOrDefault(v => v.ViewName == backendViewName) as IDetailFormViewDefinition;

            if (backendEditViewDefinition != null)
            {
                var advancedSection = backendEditViewDefinition.Sections.FirstOrDefault(s => s.Name == FormsDefinitionsExtender.AdvancedSectionName);
                if (advancedSection != null)
                {
                    var fieldDefinition = this.BuildFrameworkChoiceFieldDefinition(displayMode);
                    ((IList <IFieldDefinition>)advancedSection.Fields).Add(fieldDefinition);
                }
            }
        }
        private void ExtendBackendDefinition(IContentViewControlDefinition contentViewControlDefinition, string backendViewName, FieldDisplayMode displayMode)
        {
            var choices = new List <ChoiceDefinition>();

            choices.Add(new ChoiceDefinition()
            {
                Text            = "MVCOnly",
                ResourceClassId = typeof(FormsResources).Name,
                Value           = ((int)FormFramework.Mvc).ToString()
            });

            choices.Add(new ChoiceDefinition()
            {
                Text            = "WebFormsOnly",
                ResourceClassId = typeof(FormsResources).Name,
                Value           = ((int)FormFramework.WebForms).ToString()
            });

            FormsDefinitionExtenderHelper.ExtendFormsFrameworkFieldDefinition(contentViewControlDefinition, backendViewName, displayMode, choices);
        }
 public void ExtendDefinition(IContentViewControlDefinition contentViewControlDefinition)
 {
     this.ExtendBackendDefinition(contentViewControlDefinition, "FormsBackendInsert", FieldDisplayMode.Write);
     this.ExtendBackendDefinition(contentViewControlDefinition, "FormsBackendEdit", FieldDisplayMode.Read);
     this.ExtendBackendDefinition(contentViewControlDefinition, "FormsBackendDuplicate", FieldDisplayMode.Read);
 }
 public void ExtendDefinition(IContentViewControlDefinition contentViewControlDefinition)
 {
     this.ExtendBackendDefinition(contentViewControlDefinition, "FormsBackendInsert", FieldDisplayMode.Write);
     this.ExtendBackendDefinition(contentViewControlDefinition, "FormsBackendEdit", FieldDisplayMode.Read);
     this.ExtendBackendDefinition(contentViewControlDefinition, "FormsBackendDuplicate", FieldDisplayMode.Read);
 }
 public void ExtendDefinition(IContentViewControlDefinition contentViewControlDefinition)
 {
     this.ExtendBackendDefinition(contentViewControlDefinition, FormsDefinitionExtenderHelper.FormsBackendInsertViewName, FieldDisplayMode.Write);
     this.ExtendBackendDefinition(contentViewControlDefinition, FormsDefinitionExtenderHelper.FormsBackendEditViewName, FieldDisplayMode.Read);
     this.ExtendBackendDefinition(contentViewControlDefinition, FormsDefinitionExtenderHelper.FormsBackendDuplicateViewName, FieldDisplayMode.Read);
 }