public BlogHomepageHandler(XmlElement configEl) { string blogProperty = XmlUtil.ReadString(configEl, "@blogProperty", null); if (blogProperty == null) throw new ConfigurationException("BlogHomepageHandler requires a 'blogProperty' attribute"); _blogConfig = ConfigProperties.Instance[blogProperty] as BlogConfig; if (_blogConfig == null) throw new ConfigurationException("Property '" + blogProperty + "' was missing or invalid"); _template = Template.Compile( StringUtil.StripIndentation(configEl.InnerText), new ArgumentDescription(typeof(BlogConfig), "blogConfig")); }
public FilesystemHandler(XmlElement configEl) { _basePath = XmlUtil.ReadString(configEl, "@basePath", null); if (!_basePath.EndsWith("/")) _basePath += "/"; string rootDir = XmlUtil.ReadPath(configEl, "@rootDir", null); _rootDir = Util.PathCanonicalize(rootDir); if (!_rootDir.EndsWith("\\")) _rootDir += "\\"; _allowDirectoryBrowsing = XmlUtil.ReadBool(configEl, "@allowDirectoryBrowsing", false); _indexTemplate = Template.Compile(DIR_TEMPLATE, new ArgumentDescription(typeof(string), "path"), new ArgumentDescription(typeof(string[]), "dirs"), new ArgumentDescription(typeof(string[]), "files")); }