本文整理汇总了C#中Display.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# Display.WriteLine方法的具体用法?C# Display.WriteLine怎么用?C# Display.WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display.WriteLine方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
var display = new Display(Console.Out, Console.In);
var problemLoader = new ProblemLoader(display);
bool exit = false;
while (!exit)
{
display.Write("Enter Problem Number ('q' to quit): ");
var input = display.ReadLine();
if (input == "q")
{
exit = true;
continue;
}
try
{
int problemNumber = int.Parse(input);
var problem = problemLoader.LoadProblem(problemNumber);
problem.Run();
}
catch (Exception)
{
display.WriteLine("Problem Solution does not exist for {0}.", input);
}
}
}
示例2: Execute
public void Execute(LiteEngine engine, StringScanner s, Display display, InputCommand input, Env env)
{
var cols = engine.GetCollectionNames().OrderBy(x => x).ToArray();
if (cols.Length > 0)
{
display.WriteLine(ConsoleColor.Cyan, string.Join(Environment.NewLine, cols));
}
}
示例3: Execute
public void Execute(LiteEngine engine, StringScanner s, Display display, InputCommand input, Env env)
{
var ver = s.Scan(@"\d*");
if (ver.Length > 0)
{
engine.UserVersion = Convert.ToUInt16(ver);
}
else
{
display.WriteLine(engine.UserVersion.ToString());
}
}
示例4: Execute
public override void Execute(ref IShellEngine engine, StringScanner s, Display display, InputCommand input)
{
var connectionString = s.Scan(@".+");
if (engine != null)
{
engine.Dispose();
}
// get filename, detect engine and open
var filename = this.GetFilename(connectionString);
engine = this.DetectEngine(filename);
engine.Open(connectionString);
// get engine version and display info
var ver = engine.Version;
display.WriteLine(ConsoleColor.DarkCyan, string.Format("open \"{0}\" (v{1}.{2}.{3})",
Path.GetFileName(filename), ver.Major, ver.Minor, ver.Build));
}