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;
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        private static void InitializeConfig()
        {
            InitializeConfig("brail");

            if (options == null)
            {
                InitializeConfig("Brail");
            }

            if (options == null)
            {
                options = new BooViewEngineOptions();
            }
        }
 public TransformToBrailStep(BooViewEngineOptions options)
 {
     this.options = options;
 }
Esempio n. 5
0
 private static void InitializeConfig(string sectionName)
 {
     options = ConfigurationManager.GetSection(sectionName) as BooViewEngineOptions;
 }
Esempio n. 6
0
        private static void InitializeConfig()
        {
            InitializeConfig("brail");

            if (options == null)
            {
                InitializeConfig("Brail");
            }

            if (options == null)
            {
                options = new BooViewEngineOptions();
            }
        }
Esempio n. 7
0
		public TransformToBrailStep(BooViewEngineOptions options)
		{
			this.options = options;
		}
Esempio n. 8
0
 private static void InitializeConfig(string sectionName)
 {
     options = ConfigurationManager.GetSection(sectionName) as BooViewEngineOptions;
 }