public TemplateDeclarationConfig(XmlNode section)
		{
			XmlElement root = (XmlElement) section;
			baseDir = root.GetAttribute("baseDirectory");
			if (Logic.StringEmpty(baseDir))
				baseDir = "~";

			string defaultID = root.GetAttribute("default");

			foreach (XmlElement templateEl in root.SelectNodes("*"))
			{
				TemplateDeclaration t;
				switch (templateEl.Name)
				{
					case "headerAndFooterTemplate":
						t = new HeaderAndFooterTemplateDeclaration(this, templateEl);
						templates.Add(t.Name, t);
						break;
					default:
						throw new ConfigurationException("Template declaration not recognized: " + templateEl.Name, templateEl);
				}
				if (String.Compare(defaultID, t.Name, true) == 0)
					defaultTemplate = t;
			}
		}
예제 #2
0
        public TemplateDeclarationConfig(XmlNode section)
        {
            XmlElement root = (XmlElement)section;

            baseDir = root.GetAttribute("baseDirectory");
            if (Logic.StringEmpty(baseDir))
            {
                baseDir = "~";
            }

            string defaultID = root.GetAttribute("default");

            foreach (XmlElement templateEl in root.SelectNodes("*"))
            {
                TemplateDeclaration t;
                switch (templateEl.Name)
                {
                case "headerAndFooterTemplate":
                    t = new HeaderAndFooterTemplateDeclaration(this, templateEl);
                    templates.Add(t.Name, t);
                    break;

                default:
                    throw new ConfigurationException("Template declaration not recognized: " + templateEl.Name, templateEl);
                }
                if (String.Compare(defaultID, t.Name, true) == 0)
                {
                    defaultTemplate = t;
                }
            }
        }