public static void AddExtensionPageProperty(PageType pageType) { if (pageType.Definitions.Find(def => def.Name == "ExtensionPageProperty") == null) { if (pageType.Definitions.Find(def => def.Name == "ExtensionPageProperty") == null) { var item = new PageDefinition(); item.PageTypeID = pageType.ID; item.Name = "ExtensionPageProperty"; item.EditCaption = "ExtensionPageProperty"; item.HelpText = "Specialized For Extension Added By Extension (Do not remove)"; item.DefaultValueType = DefaultValueType.None; item.DefaultValue = ""; item.Type = PageTypeManager.ExtensionPageDefinitionType; item.ID = 0; item.Searchable = true; item.Tab = PageTypeManager.LoadExtensionTab(); item.DisplayEditUI = true; item.LanguageSpecific = true; item.LongStringSettings = 0; item.Save(); item.ClearCache(); pageType.Definitions.Add(item); } } PageDefinitionType.ClearCache(); }
public static void AddContentAreaProperty(PageType pageType, string name, string description) { Predicate <PageDefinition> match = null; if (pageType.Definitions.Find(def => def.Name == name) == null) { match = delegate(PageDefinition def) { return(def.Name == name); }; if (pageType.Definitions.Find(match) == null) { var item = new PageDefinition(); item.PageTypeID = pageType.ID; item.Name = name; item.EditCaption = name; item.HelpText = description; item.DefaultValueType = DefaultValueType.None; item.DefaultValue = ""; item.Type = PageTypeManager.ContentAreaPropertyType; item.ID = 0; item.Searchable = true; item.Tab = PageTypeManager.LoadExtensionTab(); item.DisplayEditUI = false; item.LanguageSpecific = false; item.LongStringSettings = 0; item.Save(); item.ClearCache(); pageType.Definitions.Add(item); PageDefinitionType.ClearCache(); } } }
public static void AddContentAreaProperty(PageType pageType, string name, string description) { Predicate <PageDefinition> match = null; if (pageType.Definitions.Find(def => def.Name == name) == null) { match = delegate(PageDefinition def) { return(def.Name == name); }; if (pageType.Definitions.Find(match) == null) { var item = new PageDefinition { PageTypeID = pageType.ID, Name = name, EditCaption = name, HelpText = string.IsNullOrEmpty(description) ? string.Empty : description, DefaultValueType = DefaultValueType.None, DefaultValue = "", Type = PageTypeManager.ContentAreaPropertyType, ID = 0, Searchable = true, Tab = PageTypeManager.LoadExtensionTab(), DisplayEditUI = false, LanguageSpecific = false, LongStringSettings = 0 }; item.Save(); item.ClearCache(); pageType.Definitions.Add(item); PageDefinitionType.ClearCache(); } } }