Esempio n. 1
0
        public ScriptExecutor(
            IFileSystem fileSystem,
            IFilePreProcessor filePreProcessor,
            IScriptEngine scriptEngine,
            ILogProvider logProvider,
            IScriptLibraryComposer composer,
            IScriptInfo scriptInfo)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgumentProperty("fileSystem", "BinFolder", fileSystem.BinFolder);
            Guard.AgainstNullArgumentProperty("fileSystem", "DllCacheFolder", fileSystem.DllCacheFolder);
            Guard.AgainstNullArgument("filePreProcessor", filePreProcessor);
            Guard.AgainstNullArgument("scriptEngine", scriptEngine);
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("composer", composer);
            Guard.AgainstNullArgument("scriptInfo", scriptInfo);

            References            = new AssemblyReferences(new[] { GetAssemblyFromName("System.Runtime") }, DefaultReferences);
            Namespaces            = new ReadOnlyCollection <string>(DefaultNamespaces);
            FileSystem            = fileSystem;
            FilePreProcessor      = filePreProcessor;
            ScriptEngine          = scriptEngine;
            _log                  = logProvider.ForCurrentType();
            ScriptLibraryComposer = composer;
            ScriptInfo            = scriptInfo;
        }
Esempio n. 2
0
        public ScriptExecutor(
            IFileSystem fileSystem,
            IFilePreProcessor filePreProcessor,
            IScriptEngine scriptEngine,
            ILogProvider logProvider,
            IScriptLibraryComposer composer)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgumentProperty("fileSystem", "BinFolder", fileSystem.BinFolder);
            Guard.AgainstNullArgumentProperty("fileSystem", "DllCacheFolder", fileSystem.DllCacheFolder);
            Guard.AgainstNullArgument("filePreProcessor", filePreProcessor);
            Guard.AgainstNullArgument("scriptEngine", scriptEngine);
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("composer", composer);

            References = new AssemblyReferences(DefaultReferences);
            Namespaces = new Collection <string>();
            ImportNamespaces(DefaultNamespaces);
            FileSystem       = fileSystem;
            FilePreProcessor = filePreProcessor;
            ScriptEngine     = scriptEngine;
            _log             = logProvider.ForCurrentType();
#pragma warning disable 618
            Logger = new ScriptCsLogger(_log);
#pragma warning restore 618
            ScriptLibraryComposer = composer;
        }
Esempio n. 3
0
        public PackageAssemblyResolver(IFileSystem fileSystem, IPackageContainer packageContainer, ILog logger)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgumentProperty("fileSystem", "PackagesFolder", fileSystem.PackagesFolder);
            Guard.AgainstNullArgumentProperty("fileSystem", "PackagesFile", fileSystem.PackagesFile);

            _fileSystem       = fileSystem;
            _packageContainer = packageContainer;
            _logger           = logger;
        }
Esempio n. 4
0
        public ScriptExecutor(IFileSystem fileSystem, IFilePreProcessor filePreProcessor, IScriptEngine scriptEngine, ILog logger)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgumentProperty("fileSystem", "BinFolder", fileSystem.BinFolder);
            Guard.AgainstNullArgumentProperty("fileSystem", "DllCacheFolder", fileSystem.DllCacheFolder);

            References = new AssemblyReferences();
            AddReferences(DefaultReferences);
            Namespaces = new Collection <string>();
            ImportNamespaces(DefaultNamespaces);
            FileSystem       = fileSystem;
            FilePreProcessor = filePreProcessor;
            ScriptEngine     = scriptEngine;
            Logger           = logger;
        }
Esempio n. 5
0
        public AssemblyResolver(
            IFileSystem fileSystem,
            IPackageAssemblyResolver packageAssemblyResolver,
            IAssemblyUtility assemblyUtility,
            ILog logger)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgumentProperty("fileSystem", "PackagesFolder", fileSystem.PackagesFolder);
            Guard.AgainstNullArgumentProperty("fileSystem", "BinFolder", fileSystem.BinFolder);

            _fileSystem = fileSystem;
            _packageAssemblyResolver = packageAssemblyResolver;
            _logger          = logger;
            _assemblyUtility = assemblyUtility;
        }
Esempio n. 6
0
        public PackageAssemblyResolver(
            IFileSystem fileSystem, IPackageContainer packageContainer, ILogProvider logProvider, IAssemblyUtility assemblyUtility)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgumentProperty("fileSystem", "PackagesFolder", fileSystem.PackagesFolder);
            Guard.AgainstNullArgumentProperty("fileSystem", "PackagesFile", fileSystem.PackagesFile);

            Guard.AgainstNullArgument("packageContainer", packageContainer);
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("assemblyUtility", assemblyUtility);

            _fileSystem       = fileSystem;
            _packageContainer = packageContainer;
            _logger           = logProvider.ForCurrentType();
            _assemblyUtility  = assemblyUtility;
        }