本文整理汇总了C#中Session.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# Session.WriteLine方法的具体用法?C# Session.WriteLine怎么用?C# Session.WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session.WriteLine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(Session session, CommandLine line)
{
session.WriteLine("usage:");
session.WriteLine(" <command> [patameters ...]");
session.WriteLine();
session.WriteLine("commands:");
var mapper = session.GetCommandMapper(line);
if (mapper == null)
{
foreach (var m in session.Engine.MapperManager.GetCommandMappers())
{
this.HelpFor(m, session, line);
}
}
else
{
this.HelpFor(mapper, session, line);
var parameterFormater = session.Engine.GetCommandMember(z => z.ParametersFormater);
var ParameterParser = session.Engine.GetCommandMember(z => z.CommandParameterParser);
session.WriteLine();
session.WriteLine("parameters:");
foreach (var formatedString in parameterFormater.Format(mapper, mapper.ExecutorBuilder.Mappers, ParameterParser))
{
session.WriteLine(" " + formatedString);
}
}
}
示例2: HelpFor
private void HelpFor(CommandMapper mapper, Session session, CommandLine line)
{
if (mapper.HelpCommand.IsImplemented)
{
mapper.HelpCommand.GetInstance().Help(session, line);
}
else if (mapper.DesciptionCommand.IsImplemented)
{
session.WriteLine(" " + mapper.DesciptionCommand.GetInstance().Desciption);
}
else
{
var commandFormater = session.Engine.GetCommandMember(z => z.CommandFormater);
foreach (var formatedString in commandFormater.Format(mapper))
{
session.WriteLine(" " + formatedString);
}
}
}
示例3: Execute
public void Execute(Session session, CommandLine line)
{
session.WriteLine("try use --help");
}