本文整理汇总了C#中IConsole类的典型用法代码示例。如果您正苦于以下问题:C# IConsole类的具体用法?C# IConsole怎么用?C# IConsole使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IConsole类属于命名空间,在下文中一共展示了IConsole类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: RemoveTodoItemState
public RemoveTodoItemState(IConsole console, ILog log, ITodoList todoList)
: base(console, log, todoList)
{
SetNextState(typeof(ReadTodoState));
RegisterState(typeof(RemoveTodoItemState), this);
}
开发者ID:o0Tasker0o,项目名称:Logger,代码行数:7,代码来源:RemoveTodoItemState.cs
示例17: GetEV3Configuration
public static bool GetEV3Configuration(IConsole console)
{
if (UserSettings.Instance.IPAddress == "0" ||
UserSettings.Instance.DebugPort == "")
return false;
string EV3IPAddress = UserSettings.Instance.IPAddress;
string EV3DebuggerPort = UserSettings.Instance.DebugPort;
bool bValid = true;
try
{
IPAddress.Parse(EV3IPAddress);
int.Parse(EV3DebuggerPort);
}
catch (Exception ex)
{
console.Log.WriteLine(ex.Message);
bValid = false;
}
return bValid;
}
开发者ID:tudor-olariu,项目名称:monoev3,代码行数:25,代码来源:MonoBrickAddinUtility.cs
示例18: CloneRoutine
public CloneRoutine(ISolutionCloner solutionCloner, ICommandLineArgumentParser argumentParser, IConsole console, ITranslator translator)
: base(argumentParser, console, translator)
{
this.solutionCloner = solutionCloner;
solutionCloner.CurrentPathChanged += solutionCloner_CurrentPathChanged;
}
开发者ID:faktumsoftware,项目名称:Cloney,代码行数:7,代码来源:CloneRoutine.cs
示例19: ScriptServices
public ScriptServices(
IFileSystem fileSystem,
IPackageAssemblyResolver packageAssemblyResolver,
IScriptExecutor executor,
IRepl repl,
IScriptEngine engine,
IFilePreProcessor filePreProcessor,
IScriptPackResolver scriptPackResolver,
IPackageInstaller packageInstaller,
IObjectSerializer objectSerializer,
ILog logger,
IAssemblyResolver assemblyResolver,
IEnumerable<IReplCommand> replCommands,
IConsole console = null,
IInstallationProvider installationProvider = null)
{
FileSystem = fileSystem;
PackageAssemblyResolver = packageAssemblyResolver;
Executor = executor;
Repl = repl;
Engine = engine;
FilePreProcessor = filePreProcessor;
ScriptPackResolver = scriptPackResolver;
PackageInstaller = packageInstaller;
ObjectSerializer = objectSerializer;
Logger = logger;
Console = console;
AssemblyResolver = assemblyResolver;
InstallationProvider = installationProvider;
ReplCommands = replCommands;
}
开发者ID:jrusbatch,项目名称:scriptcs,代码行数:31,代码来源:ScriptServices.cs
示例20: Initialize
public static void Initialize(
IConsole console,
ISurface surface,
IStyle style,
IDrawings drawing,
IShapes shapes,
IImages images,
IControls controls,
ISounds sounds,
IKeyboard keyboard,
IMouse mouse,
ITimer timer,
IFlickr flickr,
ISpeech speech,
CancellationToken token)
{
TextWindow.Init(console);
Desktop.Init(surface);
GraphicsWindow.Init(style, surface, drawing, keyboard, mouse);
Shapes.Init(shapes);
ImageList.Init(images);
Turtle.Init(surface, drawing, shapes);
Controls.Init(controls);
Sound.Init(sounds);
Timer.Init(timer);
Stack.Init();
Flickr.Init(flickr);
Speech.Init(speech);
Program.Init(token);
}
开发者ID:mrange,项目名称:funbasic,代码行数:30,代码来源:_Library.cs
注:本文中的IConsole类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论