static void ParseDefinesDefinition(XElement definition)
        {
            XElement content      = GetClassXElement(definition, "element-content") ?? definition; // ?? definition just to make it work with the very fisrt call
            XElement briefMembers = GetClassXElement(content, "brief-members");
            var      elements     = content.Elements().Where(e => HasClassXElement(e, "element"));

            if (elements.Any())
            {
                foreach (XElement subDef in elements)
                {
                    ParseDefinesDefinition(subDef);
                }
            }
            else
            {
                ContentType.Add(new ContentTypeDefines()
                {
                    readableName = definition.Attribute("id").Value,
                    mainName     = definition.Attribute("id").Value.Replace(".", "__"),
                    defineNames  = briefMembers.Elements().Select(e => e.Attribute("id").Value).ToArray(),
                });
            }
        }
Beispiel #2
0
 private static void AddEditableText(ContentType contentType, string title, string name, int sortOrder, string formatString, string description, int maxLength, bool multiline)
 {
     ReactiveTextBoxEditorAttribute editor = new ReactiveTextBoxEditorAttribute(title, sortOrder, formatString)
     {
         Name = name,
         ContainerName = "SEO",
         MaxLength = maxLength,
         Description = description,
         Shared = false,
         PropertyType = typeof(string)
     };
     if (multiline)
         editor.TextMode = System.Web.UI.WebControls.TextBoxMode.MultiLine;
     contentType.Add(editor);
     contentType.AddProperty(new ContentPropertyAttribute(typeof(StringProperty), title, sortOrder) { Name = name, Description = description, EditorContainerName = "SEO", Shared = false });
 }