Beispiel #1
0
            public string CallTemplate(
                string templateFile, System.Text.Encoding encoding,
                params object[] values)
            {
                if (!System.IO.Path.IsPathRooted(templateFile) &&
                    this.FileInfo != null)
                {
                    templateFile = System.IO.Path.Combine(
                        this.FileInfo.DirectoryName, templateFile);
                }

                Cavingdeep.Dcg.At.AtTemplate template;
                if (cache.ContainsKey(templateFile))
                {
                    template = cache[templateFile];
                }
                else
                {
                    template = new Cavingdeep.Dcg.At.AtTemplate(templateFile, encoding);
                    template.Parse();
                    cache.Add(templateFile, template);
                }
                template.Context = values;
                return(template.Render());
            }
Beispiel #2
0
            public string CallTemplate(
                string templateFile, System.Text.Encoding encoding,
                params object[] values)
            {
                if (!System.IO.Path.IsPathRooted(templateFile) &&
                    this.FileInfo != null)
                {
                    templateFile = System.IO.Path.Combine(
                        this.FileInfo.DirectoryName, templateFile);
                }

                Cavingdeep.Dcg.At.AtTemplate template;
                if (cache.ContainsKey(templateFile))
                {
                    template = cache[templateFile];
                }
                else
                {
                    template = new Cavingdeep.Dcg.At.AtTemplate(templateFile, encoding);
                    template.Parse();
                    cache.Add(templateFile, template);
                }
                template.Context = values;
                return template.Render();
            }