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


C# IConsole类代码示例

本文整理汇总了C#中IConsole的典型用法代码示例。如果您正苦于以下问题:C# IConsole类的具体用法?C# IConsole怎么用?C# IConsole使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IConsole类属于命名空间,在下文中一共展示了IConsole类的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: Options

 public Options(IEnvironment environment, IConsole console)
 {
     _environment = environment;
     _console = console;
     AvailableOptions = new List<Option>();
     AvailableOptions.Add(Help);
 }
开发者ID:stormleoxia,项目名称:lx,代码行数:7,代码来源:Options.cs

示例3: ScriptServices

 public ScriptServices(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver, 
     IScriptExecutor executor,
     IScriptEngine engine,
     IFilePreProcessor filePreProcessor,
     IReplCommandService replCommandService,
     IScriptPackResolver scriptPackResolver, 
     IPackageInstaller packageInstaller,
     ILog logger,
     IAssemblyResolver assemblyResolver,
     IConsole console = null,
     IInstallationProvider installationProvider = null 
     )
 {
     FileSystem = fileSystem;
     PackageAssemblyResolver = packageAssemblyResolver;
     Executor = executor;
     Engine = engine;
     FilePreProcessor = filePreProcessor;
     ReplCommandService = replCommandService;
     ScriptPackResolver = scriptPackResolver;
     PackageInstaller = packageInstaller;
     Logger = logger;
     Console = console;
     AssemblyResolver = assemblyResolver;
     InstallationProvider = installationProvider;
 }
开发者ID:ktroach,项目名称:scriptcs-replcommand-infra,代码行数:28,代码来源:ScriptServices.cs

示例4: FileConsole

        public FileConsole(string path, IConsole innerConsole)
        {
            Guard.AgainstNullArgument("innerConsole", innerConsole);

            _path = path;
            _innerConsole = innerConsole;
        }
开发者ID:scriptcs,项目名称:scriptcs,代码行数:7,代码来源:FileConsole.cs

示例5: Execute

		public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
		{
			DotNetExecutionCommand cmd = (DotNetExecutionCommand) command;
			if (cmd.TargetRuntime == null)
				cmd.TargetRuntime = Runtime.SystemAssemblyService.DefaultRuntime;
			return cmd.TargetRuntime.GetExecutionHandler ().Execute (cmd, console);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:DotNetExecutionHandler.cs

示例6: Dispatcher

 public Dispatcher(IArgumentParser argumentParser, IArgumentMapFactory argumentMapFactory,
     IConsole console)
 {
     _argumentParser = argumentParser;
     _console = console;
     _argumentMapFactory = argumentMapFactory;
 }
开发者ID:developernotes,项目名称:nu,代码行数:7,代码来源:Dispatcher.cs

示例7: Execute

		public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
		{
			var cmd = (AspNetExecutionCommand) command;
			var xspPath = GetXspPath (cmd);
			
			//if it's a script, use a native execution handler
			if (xspPath.Extension != ".exe") {
				//set mono debug mode if project's in debug mode
				var envVars = cmd.TargetRuntime.GetToolsExecutionEnvironment (cmd.TargetFramework).Variables; 
				if (cmd.DebugMode) {
					envVars = new Dictionary<string, string> (envVars);
					envVars ["MONO_OPTIONS"] = "--debug";
				}
				
				var ncmd = new NativeExecutionCommand (
					xspPath, cmd.XspParameters.GetXspParameters () + " --nonstop",
					cmd.BaseDirectory, envVars);
				
				return Runtime.ProcessService.GetDefaultExecutionHandler (ncmd).Execute (ncmd, console);
			}

			// Set DEVPATH when running on Windows (notice that this has no effect unless
			// <developmentMode developerInstallation="true" /> is set in xsp2.exe.config

			var evars = cmd.TargetRuntime.GetToolsExecutionEnvironment (cmd.TargetFramework).Variables;
			if (cmd.TargetRuntime is MsNetTargetRuntime)
				evars["DEVPATH"] = Path.GetDirectoryName (xspPath);
			
			var netCmd = new DotNetExecutionCommand (
				xspPath, cmd.XspParameters.GetXspParameters () + " --nonstop",
				cmd.BaseDirectory, evars);
			netCmd.DebugMode = cmd.DebugMode;
			
			return cmd.TargetRuntime.GetExecutionHandler ().Execute (netCmd, console);
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:35,代码来源:AspNetExecutionHandler.cs

示例8: RunTests

        public TestResults RunTests(IEnumerable<IProject> projects, string baseDirectory, string buildEngine, IConsole console)
        {
            try
            {
                string processName = string.Format("{0}", Path.Combine(_currentdirectory, "mspec-clr4.exe"));

                var process = new Process
                                  {
                                      StartInfo =
                                          {
                                              FileName = processName,
                                              Arguments = BuildArguments(projects),
                                              RedirectStandardOutput = false,
                                              RedirectStandardError = true,
                                              UseShellExecute = false
                                          },

                                      EnableRaisingEvents = false
                                  };

                process.Start();
                process.WaitForExit();
                process.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }

            return CompileResults();
        }
开发者ID:DuncanButler,项目名称:nTestRunner,代码行数:31,代码来源:MSpecTestCaller.cs

示例9: ExecuteReplCommand

 public ExecuteReplCommand(
     string scriptName,
     string[] scriptArgs,
     IFileSystem fileSystem,
     IScriptPackResolver scriptPackResolver,
     IScriptEngine scriptEngine,
     IFilePreProcessor filePreProcessor,
     IObjectSerializer serializer,
     ILog logger,
     IConsole console,
     IAssemblyResolver assemblyResolver,
     IEnumerable<IReplCommand> replCommands)
 {
     _scriptName = scriptName;
     _scriptArgs = scriptArgs;
     _fileSystem = fileSystem;
     _scriptPackResolver = scriptPackResolver;
     _scriptEngine = scriptEngine;
     _filePreProcessor = filePreProcessor;
     _serializer = serializer;
     _logger = logger;
     _console = console;
     _assemblyResolver = assemblyResolver;
     _replCommands = replCommands;
 }
开发者ID:selony,项目名称:scriptcs,代码行数:25,代码来源:ExecuteReplCommand.cs

示例10: SshCommandHelper

		public SshCommandHelper(string IPAddress, ManualResetEvent executed = null, IConsole console = null, bool verbose = false)
		{
			_executed = executed;
			_console = console;
			_verbose = verbose;
			_sshClient = new SshClient(IPAddress, "root", "");
		}
开发者ID:RoninWest,项目名称:monoev3,代码行数:7,代码来源:MonoBrickAddinSshCommandHelper.cs

示例11: Execute

		public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
		{
			if (!CanExecute (command))
			    return null;
			DebugExecutionHandler h = new DebugExecutionHandler (null);
			return h.Execute (command, console);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:DebugExecutionHandlerFactory.cs

示例12: ApplicationRuntime

        public ApplicationRuntime(IConsole console, BaseRuntime commandRuntime)
        {
            this.console = console;
            this.commandRuntime = commandRuntime;

            this.console.CancelKeyPressed += CancelKeyPressed;
        }
开发者ID:gentisaliu,项目名称:webservice-examples,代码行数:7,代码来源:ApplicationRuntime.cs

示例13: ConsoleDialog

		/// <summary>
		/// Initializes a new instance of the <see cref="SelfMediaDatabase.Console.UserInterface.ConsoleDialog"/> class.
		/// </summary>
		/// <param name="console">Console.</param>
		public ConsoleDialog(IConsole console)
		{
			if (console == null)
				throw new ArgumentNullException("console");
		
			_console = console;
		}
开发者ID:crabouif,项目名称:Self-Media-Database,代码行数:11,代码来源:ConsoleDialog.cs

示例14: AlfredSpeechConsole

        /// <summary>
        /// Initializes a new instance of the <see cref="AlfredSpeechConsole" /> class.
        /// </summary>
        /// <param name="console">The console that events should be logged to.</param>
        /// <param name="factory">The event factory.</param>
        public AlfredSpeechConsole([CanBeNull] IConsole console, [CanBeNull] ConsoleEventFactory factory)
        {
            // This class can decorate other consoles, but for an empty implementation it can rely on an internal collection
            if (console == null)
            {
                console = new SimpleConsole();
            }
            _console = console;

            // Set up the event factory
            if (factory == null) { factory = new ConsoleEventFactory(); }
            EventFactory = factory;

            // Tell it what log levels we care about
            _speechEnabledLogLevels = new HashSet<LogLevel> { LogLevel.ChatResponse, LogLevel.Warning, LogLevel.Error };

            try
            {
                // Give the speech provider the existing console and not this console since it won't be online yet
                _speech = new AlfredSpeechProvider(console);
            }
            catch (InvalidOperationException ex)
            {
                // On failure creating the speech provider, just have speech be null and we'll just be a decorator
                _speech = null;
                Log("Init.Console", $"Speech could not be initialized: {ex.Message}", LogLevel.Error);
            }
        }
开发者ID:IntegerMan,项目名称:Alfred,代码行数:33,代码来源:AlfredSpeechConsole.cs

示例15: Prompt

 public Prompt(IConsole console, ICalculator calculator, IValidator validator, ILogger logger)
 {
     _console = console;
     _calculator = calculator;
     _validator = validator;
     _logger = logger;
 }
开发者ID:revlucio,项目名称:coding-tests,代码行数:7,代码来源:Prompt.cs


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