本文整理汇总了C#中IMessenger.Write方法的典型用法代码示例。如果您正苦于以下问题:C# IMessenger.Write方法的具体用法?C# IMessenger.Write怎么用?C# IMessenger.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMessenger
的用法示例。
在下文中一共展示了IMessenger.Write方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
/// <summary>
/// Runs an appropriate Action method
/// </summary>
/// <param name="targetType">Type where to search for Action methods</param>
/// <param name="args">Arguments that will be converted to Action method arguments</param>
/// <param name="messenger">Uses for writing messages instead of Console class methods</param>
public static void Run(Type targetType, string[] args, IMessenger messenger)
{
try
{
new Consolery(targetType, args, messenger).RunAction();
}
catch (NConsolerException e)
{
messenger.Write(e.Message);
}
}
示例2: Run
/// <summary>
/// Runs an appropriate Action method
/// </summary>
/// <param name="targetType">Type where to search for Action methods</param>
/// <param name="args">Arguments that will be converted to Action method arguments</param>
/// <param name="messenger">Uses for writing messages instead of Console class methods</param>
/// <param name="notationType">Switch for command line syntax. Windows: /param:value Linux: -param value</param>
public static void Run(Type targetType, string[] args, IMessenger messenger, Notation notationType = Notation.Windows)
{
try
{
new Consolery(targetType, null, args, messenger, notationType).RunAction();
}
catch (NConsolerException e)
{
messenger.Write(e.Message);
const int genericErrorExitCode = 1;
Environment.ExitCode = genericErrorExitCode;
}
}
示例3: Run
/// <summary>
/// Runs an appropriate Action method
/// </summary>
/// <param name="target">Type where to search for Action methods</param>
/// <param name="args">Arguments that will be converted to Action method arguments</param>
/// <param name="messenger">Uses for writing messages instead of Console class methods</param>
/// <param name="notationType">Switch for command line syntax. Windows: /param:value Linux: -param value</param>
public static void Run(object target, string[] args, IMessenger messenger, Notation notationType = Notation.Windows)
{
Contract.Requires(target != null);
try
{
new Consolery(target.GetType(), target, args, messenger, notationType).RunAction();
}
catch (NConsolerException e)
{
messenger.Write(e.Message);
}
}
示例4: RunInstance
/// <summary>
/// Runs an appropriate Action method
/// </summary>
/// <param name="targetObject">Object where to search for Action methods</param>
/// <param name="args">Arguments that will be converted to Action method arguments</param>
/// <param name="messenger">Uses for writing messages instead of Console class methods</param>
public static int RunInstance(object targetObject, string[] args, IMessenger messenger)
{
try
{
return new Consolery(targetObject.GetType(), args, messenger, true, targetObject).RunAction();
}
catch (NConsolerException e)
{
messenger.Write(e.Message);
return 100;
}
}
示例5: Run
/// <summary>
/// Runs an appropriate Action method
/// </summary>
/// <param name="targetType">Type where to search for Action methods</param>
/// <param name="args">Arguments that will be converted to Action method arguments</param>
/// <param name="messenger">Uses for writing messages instead of Console class methods</param>
public static int Run(Type targetType, string[] args, IMessenger messenger)
{
try
{
return new Consolery(targetType, args, messenger, false, null).RunAction();
}
catch (NConsolerException e)
{
messenger.Write(e.Message);
return 100;
}
}