当前位置: 首页>>代码示例>>C#>>正文


C# ILogProvider.ForCurrentType方法代码示例

本文整理汇总了C#中ILogProvider.ForCurrentType方法的典型用法代码示例。如果您正苦于以下问题:C# ILogProvider.ForCurrentType方法的具体用法?C# ILogProvider.ForCurrentType怎么用?C# ILogProvider.ForCurrentType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILogProvider的用法示例。


在下文中一共展示了ILogProvider.ForCurrentType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExecuteReplCommand

        public ExecuteReplCommand(
            string scriptName,
            string[] scriptArgs,
            IFileSystem fileSystem,
            IScriptPackResolver scriptPackResolver,
            IRepl repl,
            ILogProvider logProvider,
            IConsole console,
            IAssemblyResolver assemblyResolver,
            IFileSystemMigrator fileSystemMigrator,
            IScriptLibraryComposer composer)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("scriptPackResolver", scriptPackResolver);
            Guard.AgainstNullArgument("repl", repl);
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("console", console);
            Guard.AgainstNullArgument("assemblyResolver", assemblyResolver);
            Guard.AgainstNullArgument("fileSystemMigrator", fileSystemMigrator);
            Guard.AgainstNullArgument("composer", composer);

            _scriptName = scriptName;
            _scriptArgs = scriptArgs;
            _fileSystem = fileSystem;
            _scriptPackResolver = scriptPackResolver;
            _repl = repl;
            _logger = logProvider.ForCurrentType();
            _console = console;
            _assemblyResolver = assemblyResolver;
            _fileSystemMigrator = fileSystemMigrator;
            _composer = composer;
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:32,代码来源:ExecuteReplCommand.cs

示例2: CommonScriptEngine

 protected CommonScriptEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
 {
     Guard.AgainstNullArgument("logProvider", logProvider);
     ScriptOptions = new ScriptOptions().WithReferences(typeof(Object).Assembly);
     _scriptHostFactory = scriptHostFactory;
     _log = logProvider.ForCurrentType();
 }
开发者ID:scriptcs,项目名称:scriptcs,代码行数:7,代码来源:CommonScriptEngine.cs

示例3: ModuleLoader

        public ModuleLoader(IAssemblyResolver resolver, ILogProvider logProvider, Action<Assembly, AggregateCatalog> addToCatalog, Func<CompositionContainer, IEnumerable<Lazy<IModule, IModuleMetadata>>> getLazyModules, IFileSystem fileSystem, IAssemblyUtility assemblyUtility)
        {
            Guard.AgainstNullArgument("logProvider", logProvider);

            _resolver = resolver;
            _logger = logProvider.ForCurrentType();

            if (addToCatalog == null)
            {
                addToCatalog = (assembly, catalog) =>
                {
                    try
                    {
                        var assemblyCatalog = new AssemblyCatalog(assembly);
                        catalog.Catalogs.Add(assemblyCatalog);
                    }
                    catch (Exception exception)
                    {
                        _logger.DebugFormat("Module Loader exception: {0}", exception.Message);
                    }
                };
            }

            _addToCatalog = addToCatalog;

            if (getLazyModules == null)
            {
                getLazyModules = container => container.GetExports<IModule, IModuleMetadata>();
            }

            _getLazyModules = getLazyModules;
            _fileSystem = fileSystem;
            _assemblyUtility = assemblyUtility;
        }
开发者ID:AsCloud,项目名称:scriptcs,代码行数:34,代码来源:ModuleLoader.cs

示例4: WatchScriptCommand

        public WatchScriptCommand(
            Config config,
            string[] scriptArgs,
            IConsole console,
            IFileSystem fileSystem,
            ILogProvider logProvider,
            IFileSystemMigrator fileSystemMigrator)
        {
            Guard.AgainstNullArgument("config", config);
            Guard.AgainstNullArgument("scriptArgs", scriptArgs);
            Guard.AgainstNullArgument("console", console);
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("fileSystemMigrator", fileSystemMigrator);

            _config = config;
            _scriptArgs = scriptArgs;
            _console = console;
            _fileSystem = fileSystem;
            _logger = logProvider.ForCurrentType();
            _fileSystemMigrator = fileSystemMigrator;

            _executeScriptCommand = new CrossAppDomainExecuteScriptCommand
            {
                Config = _config,
                ScriptArgs = _scriptArgs,
            };
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:28,代码来源:WatchScriptCommand.cs

示例5: ExecuteScriptCommand

        public ExecuteScriptCommand(
            string script,
            string[] scriptArgs,
            IFileSystem fileSystem,
            IScriptExecutor scriptExecutor,
            IScriptPackResolver scriptPackResolver,
            ILogProvider logProvider,
            IAssemblyResolver assemblyResolver,
            IFileSystemMigrator fileSystemMigrator,
            IScriptLibraryComposer composer
            )
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("scriptExecutor", scriptExecutor);
            Guard.AgainstNullArgument("scriptPackResolver", scriptPackResolver);
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("assemblyResolver", assemblyResolver);
            Guard.AgainstNullArgument("fileSystemMigrator", fileSystemMigrator);
            Guard.AgainstNullArgument("composer", composer);

            _script = script;
            ScriptArgs = scriptArgs;
            _fileSystem = fileSystem;
            _scriptExecutor = scriptExecutor;
            _scriptPackResolver = scriptPackResolver;
            _logger = logProvider.ForCurrentType();
            _assemblyResolver = assemblyResolver;
            _fileSystemMigrator = fileSystemMigrator;
            _composer = composer;
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:30,代码来源:ExecuteScriptCommand.cs

示例6: FileSystemMigrator

        public FileSystemMigrator(IFileSystem fileSystem, ILogProvider logProvider)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("logProvider", logProvider);

            _fileSystem = fileSystem;
            _logger = logProvider.ForCurrentType();

            _fileCopies = new Dictionary<string, string>
            {
                { "packages.config", _fileSystem.PackagesFile },
                { "nuget.config", _fileSystem.NugetFile },
            };

            _directoryMoves = new Dictionary<string, string>
            {
                { ".cache", _fileSystem.DllCacheFolder },
            };

            _directoryCopies = new Dictionary<string, string>
            {
                { "bin", _fileSystem.BinFolder },
                { "packages", _fileSystem.PackagesFolder },
            };
        }
开发者ID:AsCloud,项目名称:scriptcs,代码行数:25,代码来源:FileSystemMigrator.cs

示例7: RoslynScriptInMemoryEngine

        public RoslynScriptInMemoryEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
            : base(scriptHostFactory, logProvider)
        {
            Guard.AgainstNullArgument("logProvider", logProvider);

            _log = logProvider.ForCurrentType();
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:7,代码来源:RoslynScriptInMemoryEngine.cs

示例8: AppDomainAssemblyResolver

        public AppDomainAssemblyResolver(
            ILogProvider logProvider,
            IFileSystem fileSystem,
            IAssemblyResolver resolver,
            IAssemblyUtility assemblyUtility,
            IDictionary<string, AssemblyInfo> assemblyInfoMap = null,
            Func<object, ResolveEventArgs, Assembly> resolveHandler = null)
        {
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("resolver", resolver);
            Guard.AgainstNullArgument("assemblyUtility", assemblyUtility);

            _assemblyInfoMap = assemblyInfoMap ?? new Dictionary<string, AssemblyInfo>();
            _assemblyUtility = assemblyUtility;
            _logger = logProvider.ForCurrentType();
            _fileSystem = fileSystem;
            _resolver = resolver;

            if (resolveHandler == null)
            {
                resolveHandler = AssemblyResolve;
            }

            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(resolveHandler);
        }
开发者ID:AsCloud,项目名称:scriptcs,代码行数:26,代码来源:AppDomainAssemblyResolver.cs

示例9: CSharpPersistentEngine

 public CSharpPersistentEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider, IFileSystem fileSystem)
     : base(scriptHostFactory, logProvider)
 {
     Guard.AgainstNullArgument("logProvider", logProvider);
     _log = logProvider.ForCurrentType();
     _fileSystem = fileSystem;
 }
开发者ID:scriptcs,项目名称:scriptcs,代码行数:7,代码来源:CSharpPersistentEngine.cs

示例10: PackageContainer

        public PackageContainer(IFileSystem fileSystem, ILogProvider logProvider)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("logProvider", logProvider);

            _fileSystem = fileSystem;
            _logger = logProvider.ForCurrentType();
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:8,代码来源:PackageContainer.cs

示例11: RoslynScriptCompilerEngine

        protected RoslynScriptCompilerEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
            : base(scriptHostFactory, logProvider)
        {
            Guard.AgainstNullArgument("logProvider", logProvider);

            _log = logProvider.ForCurrentType();

        }
开发者ID:AsCloud,项目名称:scriptcs,代码行数:8,代码来源:RoslynScriptCompilerEngine.cs

示例12: NugetInstallationProvider

        public NugetInstallationProvider(IFileSystem fileSystem, ILogProvider logProvider)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("logProvider", logProvider);

            _fileSystem = fileSystem;
            _logger = logProvider.ForCurrentType();
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:8,代码来源:NugetInstallationProvider.cs

示例13: PackageInstaller

        public PackageInstaller(IInstallationProvider installer, ILogProvider logProvider)
        {
            Guard.AgainstNullArgument("installer", installer);
            Guard.AgainstNullArgument("logProvider", logProvider);

            _installer = installer;
            _logger = logProvider.ForCurrentType();
        }
开发者ID:AsCloud,项目名称:scriptcs,代码行数:8,代码来源:PackageInstaller.cs

示例14: FilePreProcessor

        public FilePreProcessor(IFileSystem fileSystem, ILogProvider logProvider, IEnumerable<ILineProcessor> lineProcessors)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("logProvider", logProvider);

            _fileSystem = fileSystem;
            _logger = logProvider.ForCurrentType();
            _lineProcessors = lineProcessors;
        }
开发者ID:AsCloud,项目名称:scriptcs,代码行数:9,代码来源:FilePreProcessor.cs

示例15: SaveCommand

        public SaveCommand(IPackageAssemblyResolver packageAssemblyResolver, IFileSystem fileSystem, ILogProvider logProvider)
        {
            Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("logProvider", logProvider);

            _packageAssemblyResolver = packageAssemblyResolver;
            _fileSystem = fileSystem;
            _logger = logProvider.ForCurrentType();
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:10,代码来源:SaveCommand.cs


注:本文中的ILogProvider.ForCurrentType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。