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); }
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; }
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); }
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); }
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); } }
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); }