Exemple #1
0
        public ProjectTemplatingHost(ILogger log, string templateFile, string rootDirectory, ExpandoObject expando, IEnumerable<string> assemblies)
        {
            if (log == null) throw new ArgumentNullException("log");
            if (templateFile == null) throw new ArgumentNullException("templateFile");
            if (rootDirectory == null) throw new ArgumentNullException("rootDirectory");
            if (expando == null) throw new ArgumentNullException("expando");
            this.log = log;
            this.TemplateFile = templateFile;
            this.rootDirectory = rootDirectory;

            Session = new CustomTemplatingSession(expando);

            var assembliesToLoad = new List<string>()
                {
                    "System.Core",
                    typeof(RuntimeBinderException).Assembly.FullName,
                    "Mono.TextTemplating",
                    typeof(PlatformType).Assembly.FullName,
                    typeof(UPath).Assembly.FullName,
                    "SiliconStudio.ProjectTemplating"
                };
            assembliesToLoad.AddRange(assemblies);
            StandardAssemblyReferences = assembliesToLoad;

            StandardImports = new List<string>()
                {
                    "System.Linq",
                    "System.Text",
                    "System.Collections.Generic",
                    "System.Dynamic",
                    "SiliconStudio.ProjectTemplating"
                };
        }
        public ProjectTemplatingHost(ILogger log, string templateFile, string rootDirectory, ExpandoObject expando, IEnumerable <string> assemblies)
        {
            if (log == null)
            {
                throw new ArgumentNullException("log");
            }
            if (templateFile == null)
            {
                throw new ArgumentNullException("templateFile");
            }
            if (rootDirectory == null)
            {
                throw new ArgumentNullException("rootDirectory");
            }
            if (expando == null)
            {
                throw new ArgumentNullException("expando");
            }
            this.log           = log;
            this.TemplateFile  = templateFile;
            this.rootDirectory = rootDirectory;

            Session = new CustomTemplatingSession(expando);

            var assembliesToLoad = new List <string>()
            {
                "System.Core",
                typeof(RuntimeBinderException).Assembly.FullName,
                "Mono.TextTemplating",
                typeof(PlatformType).Assembly.FullName,
                typeof(UPath).Assembly.FullName,
                "SiliconStudio.ProjectTemplating"
            };

            assembliesToLoad.AddRange(assemblies);
            StandardAssemblyReferences = assembliesToLoad;

            StandardImports = new List <string>()
            {
                "System.Linq",
                "System.Text",
                "System.Collections.Generic",
                "System.Dynamic",
                "SiliconStudio.ProjectTemplating"
            };
        }