コード例 #1
0
 private void AddEditableText(ItemDefinition definition, string title, string name, int sortOrder, int maxLength)
 {
     EditableTextBoxAttribute titleEditor = new EditableTextBoxAttribute(title, sortOrder, maxLength);
     titleEditor.Name = name;
     titleEditor.ContainerName = "seo";
     definition.Add(titleEditor);
 }
コード例 #2
0
        private void AddEditableText(ItemDefinition definition, string title, string name, int sortOrder, int maxLength)
        {
            EditableTextBoxAttribute titleEditor = new EditableTextBoxAttribute(title, sortOrder, maxLength);

            titleEditor.Name          = name;
            titleEditor.ContainerName = "seo";
            definition.Add(titleEditor);
        }
コード例 #3
0
 private EditableTextAttribute AddEditableText(ItemDefinition definition, string title, string name, int sortOrder, int maxLength)
 {
     EditableTextAttribute editor = new EditableTextAttribute(title, sortOrder);
     editor.MaxLength = maxLength;
     editor.Name = name;
     editor.ContainerName = Tabs.Details;
     definition.Add(editor);
     return editor;
 }
コード例 #4
0
        private EditableTextBoxAttribute AddEditableText(ItemDefinition definition, string title, string name, int sortOrder, int maxLength)
        {
            EditableTextBoxAttribute editor = new EditableTextBoxAttribute(title, sortOrder, maxLength);

            editor.Name          = name;
            editor.ContainerName = Tabs.Details;
            definition.Add(editor);
            return(editor);
        }
コード例 #5
0
        public ItemDefinition AppendDefinition(ItemDefinition definition)
        {
            definition.Title    = Title;
            definition.Template = Template;

            foreach (var c in Containables)
            {
                definition.Add(c.Value);
            }

            foreach (var dv in ContentModifiers)
            {
                definition.ContentTransformers.Add(dv);
            }

            return(definition);
        }
コード例 #6
0
ファイル: DefinitionBuilder.cs プロジェクト: amarwadi/n2cms
        void AddContainable(ItemDefinition definition, ContainableElement editable)
        {
            Type editableType = EnsureType <IEditable>(editable.Type);

            try
            {
                IContainable containable = Activator.CreateInstance(editableType) as IContainable;
                Utility.SetProperty(containable, "Name", editable.Name);
                Utility.SetProperty(containable, "Title", editable.Title);
                Utility.SetProperty(containable, "ContainerName", editable.ContainerName);
                Utility.SetProperty(containable, "SortOrder", editable.SortOrder);
                foreach (string key in editable.EditableProperties.Keys)
                {
                    Utility.SetProperty(containable, key, editable.EditableProperties[key]);
                }
                definition.Add(containable);
            }
            catch (MissingMethodException ex)
            {
                throw new ConfigurationErrorsException("The type '" + editable.Type + "' defined in the configuration does not have a parameterless public constructor. This is required for the type to be configurable.", ex);
            }
        }
コード例 #7
0
        public ItemDefinition AppendToDefinition(ItemDefinition definition)
        {
            definition.Title       = Title;
            definition.TemplateKey = TemplateKey;

            foreach (var c in Containables)
            {
                definition.Add(c);
            }

            foreach (var dv in ContentModifiers)
            {
                definition.ContentTransformers.Add(dv);
            }

            foreach (var refiner in Refiners.OrderBy(r => r.RefinementOrder))
            {
                refiner.Refine(definition, new[] { definition });
            }

            return(definition);
        }