本文整理汇总了C#中IrcMessage.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IrcMessage.ToString方法的具体用法?C# IrcMessage.ToString怎么用?C# IrcMessage.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IrcMessage
的用法示例。
在下文中一共展示了IrcMessage.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IrcMsg_ToStringArgWithSpace
public void IrcMsg_ToStringArgWithSpace()
{
var expected = ":prefix PRIVMSG blabla :string with a lot of spaces";
var actual = new IrcMessage("PRIVMSG", "prefix", "blabla", "string with a lot of spaces");
Assert.AreEqual(expected, actual.ToString());
}
示例2: ProcessMessageJoin
protected internal void ProcessMessageJoin(IrcMessage message)
{
logger.Debug("ProcessMessageJoin - Process JOIN messages received from the server:");
logger.Debug(message.ToString());
var sourceUser = message.Source as IrcUser;
if (sourceUser == null)
throw new ProtocolViolationException(string.Format(
Properties.Resources.MessageSourceNotUser, message.Source.Name));
// Local or remote user has joined one or more channels.
Debug.Assert(message.Parameters[0] != null);
var channels = GetChannelsFromList(message.Parameters[0]).ToArray();
if (sourceUser == this.localUser)
channels.ForEach(c => this.localUser.HandleJoinedChannel(c));
else
channels.ForEach(c => c.HandleUserJoined(new IrcChannelUser(sourceUser)));
}
示例3: SendMessage
/// <summary>
/// Broadcasts an <see cref="IRCSharp.IrcMessage"/> to all users listening on this channel.
/// </summary>
/// <param name="sender">The IIrcUser that sent the message.</param>
/// <param name="message">The IrcMessage</param>
/// <param name="ignoreSender">Whether to ignore the sender when sending this message.</param>
public void SendMessage(IIrcUser sender, IrcMessage message, bool ignoreSender = false)
{
Users.Where(user =>
{
if (ignoreSender)
{
return user != sender;
}
return true;
}).ForEach(user => user.Write(message));
IrcServer.Logger.Log(LogLevel.Debug, message.ToString());
}
示例4: IrcMsg_ToStringWithPrefixNoArgs
public void IrcMsg_ToStringWithPrefixNoArgs()
{
var expected = ":jakub PING";
var actual = new IrcMessage("PING", "jakub");
Assert.AreEqual(expected, actual.ToString());
}