本文整理汇总了C#中Repl.Terminate方法的典型用法代码示例。如果您正苦于以下问题:C# Repl.Terminate方法的具体用法?C# Repl.Terminate怎么用?C# Repl.Terminate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repl
的用法示例。
在下文中一共展示了Repl.Terminate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public CommandResult Execute()
{
_console.WriteLine("scriptcs (ctrl-c to exit)" + Environment.NewLine);
var repl = new Repl(_scriptArgs, _fileSystem, _scriptEngine, _serializer, _logger, _console, _filePreProcessor, _replCommands);
var workingDirectory = _fileSystem.CurrentDirectory;
var assemblies = _assemblyResolver.GetAssemblyPaths(workingDirectory);
var scriptPacks = _scriptPackResolver.GetPacks();
repl.Initialize(assemblies, scriptPacks, ScriptArgs);
try
{
if (!string.IsNullOrWhiteSpace(_scriptName))
{
_logger.Info(string.Format("Loading script: {0}", _scriptName));
repl.Execute(string.Format("#load {0}", _scriptName));
}
while (ExecuteLine(repl))
{
}
_console.WriteLine();
}
catch (Exception ex)
{
_logger.Error(ex.Message);
return CommandResult.Error;
}
repl.Terminate();
return CommandResult.Success;
}
示例2: Execute
public CommandResult Execute()
{
_console.WriteLine("scriptcs (ctrl-c or blank to exit)\r\n");
var repl = new Repl(_fileSystem, _scriptEngine, _logger, _console, _filePreProcessor);
repl.Initialize(GetAssemblyPaths(_fileSystem.CurrentDirectory), _scriptPackResolver.GetPacks());
try
{
while (ExecuteLine(repl))
{
}
}
catch (Exception ex)
{
_logger.Error(ex.Message);
return CommandResult.Error;
}
repl.Terminate();
return CommandResult.Success;
}
示例3: TheTerminateMethod
public TheTerminateMethod()
{
_mocks = new Mocks();
_repl = GetRepl(_mocks);
_mocks.FileSystem.Setup(x => x.CurrentDirectory).Returns(@"c:\");
_repl.Initialize(new List<string>(), new[] { _mocks.ScriptPack.Object });
_repl.Terminate();
}