public object Create(object parent, object configContext, XmlNode section) { var options = new BooViewEngineOptions(); if (section.Attributes["batch"] != null) options.BatchCompile = bool.Parse(section.Attributes["batch"].Value); if (section.Attributes["saveToDisk"] != null) options.SaveToDisk = bool.Parse(section.Attributes["saveToDisk"].Value); if (section.Attributes["debug"] != null) options.Debug = bool.Parse(section.Attributes["debug"].Value); if (section.Attributes["saveDirectory"] != null) options.SaveDirectory = section.Attributes["saveDirectory"].Value; if (section.Attributes["commonScriptsDirectory"] != null) options.CommonScriptsDirectory = section.Attributes["commonScriptsDirectory"].Value; if (section.Attributes["baseType"] != null) options.BaseType = section.Attributes["baseType"].Value; foreach(XmlNode refence in section.SelectNodes("reference")) { XmlAttribute attribute = refence.Attributes["assembly"]; if (attribute == null) throw GetConfigurationException("Attribute 'assembly' is mandatory for <reference/> tags"); Assembly asm = Assembly.Load(attribute.Value); options.AssembliesToReference.Add(asm); } foreach(XmlNode import in section.SelectNodes("import")) { XmlAttribute attribute = import.Attributes["namespace"]; if (attribute == null) throw GetConfigurationException("Attribute 'namespace' is mandatory for <import/> tags"); string name = attribute.Value; options.NamespacesToImport.Add(name); } return options; }
public object Create(object parent, object configContext, XmlNode section) { var options = new BooViewEngineOptions(); if (section.Attributes["batch"] != null) { options.BatchCompile = bool.Parse(section.Attributes["batch"].Value); } if (section.Attributes["saveToDisk"] != null) { options.SaveToDisk = bool.Parse(section.Attributes["saveToDisk"].Value); } if (section.Attributes["debug"] != null) { options.Debug = bool.Parse(section.Attributes["debug"].Value); } if (section.Attributes["saveDirectory"] != null) { options.SaveDirectory = section.Attributes["saveDirectory"].Value; } if (section.Attributes["commonScriptsDirectory"] != null) { options.CommonScriptsDirectory = section.Attributes["commonScriptsDirectory"].Value; } if (section.Attributes["baseType"] != null) { options.BaseType = section.Attributes["baseType"].Value; } foreach (XmlNode refence in section.SelectNodes("reference")) { XmlAttribute attribute = refence.Attributes["assembly"]; if (attribute == null) { throw GetConfigurationException("Attribute 'assembly' is mandatory for <reference/> tags"); } Assembly asm = Assembly.Load(attribute.Value); options.AssembliesToReference.Add(asm); } foreach (XmlNode import in section.SelectNodes("import")) { XmlAttribute attribute = import.Attributes["namespace"]; if (attribute == null) { throw GetConfigurationException("Attribute 'namespace' is mandatory for <import/> tags"); } string name = attribute.Value; options.NamespacesToImport.Add(name); } return(options); }
private static void InitializeConfig() { InitializeConfig("brail"); if (options == null) { InitializeConfig("Brail"); } if (options == null) { options = new BooViewEngineOptions(); } }
public TransformToBrailStep(BooViewEngineOptions options) { this.options = options; }
private static void InitializeConfig(string sectionName) { options = ConfigurationManager.GetSection(sectionName) as BooViewEngineOptions; }