private Slug CreateDefaultSlug() { NameEditorElement nameEditorElement = new NameEditorElement(); EditSection editSection = new EditSection { NameEditor = nameEditorElement }; ConfigurationManagerWrapper cmw = new ConfigurationManagerWrapper { Sections = new ConfigurationManagerWrapper.ContentSectionTable(null, null, null, editSection) }; return new Slug(cmw); }
private Slug CreateLowercaseSlug() { NameEditorElement nameEditorElement = new NameEditorElement { WhitespaceReplacement = '-', Replacements = new PatternValueCollection(), ToLower = true }; EditSection editSection = new EditSection { NameEditor = nameEditorElement }; ConfigurationManagerWrapper cmw = new ConfigurationManagerWrapper { Sections = new ConfigurationManagerWrapper.ContentSectionTable(null, null, null, editSection) }; return new Slug(cmw); }
private Slug CreateCustomReplacementSlug() { PatternValueCollection patterns = new PatternValueCollection(); patterns.Clear(); // to remove all those added by constructor patterns.Add(new PatternValueElement("c1", "[@]", "at", true)); NameEditorElement nameEditorElement = new NameEditorElement { // WhitespaceReplacement = '-', Replacements = patterns //, // ToLower = true }; EditSection editSection = new EditSection { NameEditor = nameEditorElement }; ConfigurationManagerWrapper cmw = new ConfigurationManagerWrapper { Sections = new ConfigurationManagerWrapper.ContentSectionTable(null, null, null, editSection) }; return new Slug(cmw); }
private static NameEditorElement LoadConfiguration() { EditSection editSection = ConfigurationManager.GetSection("n2/edit") as EditSection; if (editSection != null) return editSection.NameEditor; NameEditorElement config = new NameEditorElement(); config.WhitespaceReplacement = '-'; config.ShowKeepUpdated = true; config.ToLower = true; return config; }