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;
			foreach(XmlNode refence in section.SelectNodes("reference"))
			{
				var attribute = refence.Attributes["assembly"];
				if (attribute == null)
					throw GetConfigurationException("Attribute 'assembly' is mandatory for <reference/> tags");
				var asm = Assembly.Load(attribute.Value);
				options.AssembliesToReference.Add(asm);
			}

			foreach(XmlNode import in section.SelectNodes("import"))
			{
				var attribute = import.Attributes["namespace"];
				if (attribute == null)
					throw GetConfigurationException("Attribute 'namespace' is mandatory for <import/> tags");
				var name = attribute.Value;
				options.NamespacesToImport.Add(name);
			}
			return options;
		}
예제 #2
0
        private void InitializeConfig()
        {
            InitializeConfig("brail");

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

            if (options == null)
            {
                options = new BooViewEngineOptions();
            }
        }
        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;
            }
            foreach (XmlNode refence in section.SelectNodes("reference"))
            {
                var attribute = refence.Attributes["assembly"];
                if (attribute == null)
                {
                    throw GetConfigurationException("Attribute 'assembly' is mandatory for <reference/> tags");
                }
                var asm = Assembly.Load(attribute.Value);
                options.AssembliesToReference.Add(asm);
            }

            foreach (XmlNode import in section.SelectNodes("import"))
            {
                var attribute = import.Attributes["namespace"];
                if (attribute == null)
                {
                    throw GetConfigurationException("Attribute 'namespace' is mandatory for <import/> tags");
                }
                var name = attribute.Value;
                options.NamespacesToImport.Add(name);
            }
            return(options);
        }
예제 #4
0
		private static void InitializeConfig(string sectionName)
		{
			options = ConfigurationManager.GetSection(sectionName) as BooViewEngineOptions;
		}
예제 #5
0
		private static void InitializeConfig()
		{
			InitializeConfig("brail");

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

			if (options == null)
			{
				options = new BooViewEngineOptions();
			}
		}
		public StandaloneBooViewEngine(IViewSourceLoader viewSourceLoader, BooViewEngineOptions options)
		{
			bve.Options = options;
			bve.SetViewSourceLoader(viewSourceLoader);
			bve.Initialize();
		}
예제 #7
0
 private void InitializeConfig(string sectionName)
 {
     options = ConfigurationManager.GetSection(sectionName) as BooViewEngineOptions;
 }
		public TransformToBrailStep(BooViewEngineOptions options)
		{
			this.options = options;
		}
예제 #9
0
 public StandaloneBooViewEngine(IViewSourceLoader viewSourceLoader, BooViewEngineOptions options)
 {
     bve.Options = options;
     bve.SetViewSourceLoader(viewSourceLoader);
     bve.Initialize();
 }
예제 #10
0
 public TransformToBrailStep(BooViewEngineOptions options)
 {
     this.options = options;
 }