本文整理汇总了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;
}
示例2: Options
public Options(IEnvironment environment, IConsole console)
{
_environment = environment;
_console = console;
AvailableOptions = new List<Option>();
AvailableOptions.Add(Help);
}
示例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;
}
示例4: FileConsole
public FileConsole(string path, IConsole innerConsole)
{
Guard.AgainstNullArgument("innerConsole", innerConsole);
_path = path;
_innerConsole = innerConsole;
}
示例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);
}
示例6: Dispatcher
public Dispatcher(IArgumentParser argumentParser, IArgumentMapFactory argumentMapFactory,
IConsole console)
{
_argumentParser = argumentParser;
_console = console;
_argumentMapFactory = argumentMapFactory;
}
示例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);
}
示例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();
}
示例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;
}
示例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", "");
}
示例11: Execute
public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
{
if (!CanExecute (command))
return null;
DebugExecutionHandler h = new DebugExecutionHandler (null);
return h.Execute (command, console);
}
示例12: ApplicationRuntime
public ApplicationRuntime(IConsole console, BaseRuntime commandRuntime)
{
this.console = console;
this.commandRuntime = commandRuntime;
this.console.CancelKeyPressed += CancelKeyPressed;
}
示例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;
}
示例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);
}
}
示例15: Prompt
public Prompt(IConsole console, ICalculator calculator, IValidator validator, ILogger logger)
{
_console = console;
_calculator = calculator;
_validator = validator;
_logger = logger;
}