本文整理匯總了C#中ChatCommand.IsFor方法的典型用法代碼示例。如果您正苦於以下問題:C# ChatCommand.IsFor方法的具體用法?C# ChatCommand.IsFor怎麽用?C# ChatCommand.IsFor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ChatCommand
的用法示例。
在下文中一共展示了ChatCommand.IsFor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ProcessAlfredCommand
/// <summary>
/// Processes an Alfred Command. If the <paramref name="command"/> is handled,
/// <paramref name="result"/> should be modified accordingly and the method should
/// return true. Returning <see langword="false"/> will not stop the message from being
/// propagated.
/// </summary>
/// <param name="command"> The command. </param>
/// <param name="result">
/// The result. If the <paramref name="command"/> was handled, this should be updated.
/// </param>
/// <returns>
/// <c>True</c> if the <paramref name="command"/> was handled; otherwise false.
/// </returns>
public override bool ProcessAlfredCommand(
ChatCommand command,
[CanBeNull] AlfredCommandResult result)
{
if (result == null) { return false; }
if (command.IsFor(this) && command.Name.Matches("Status"))
{
result.Output = GetStatusText(command.Data);
return true;
}
return base.ProcessAlfredCommand(command, result);
}