Example #1
0
        public virtual void Load(TemplateResolver resolver, string name)
        {
            this._templateSourcePath = null;

            string path;
            if (resolver.Resolve(name, out this._fileProvider, out path))
            {
                using (Stream str = this._fileProvider.OpenFile(path, FileMode.Open))
                    _templateDefinition = XDocument.Load(str, LoadOptions.SetLineInfo);

                this._basePath = Path.GetDirectoryName(path);
                this._templateResolver = resolver;
            }
            else
            {
                throw new FileNotFoundException("Template not found, search paths: {0}", resolver.ToString());
            }
        }