当前位置: 首页>>代码示例>>C#>>正文


C# IrcMessage.ToString方法代码示例

本文整理汇总了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());
        }
开发者ID:jakubgarfield,项目名称:Bonobo-Irc-Library,代码行数:7,代码来源:IrcMessage.cs

示例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)));
        }
开发者ID:Sazpaimon,项目名称:MarioMakerTwitchBot,代码行数:17,代码来源:IrcClientMessageProcessing.cs

示例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());
 }
开发者ID:seaboy1234,项目名称:IRCSharp,代码行数:18,代码来源:IrcChannel.cs

示例4: IrcMsg_ToStringWithPrefixNoArgs

        public void IrcMsg_ToStringWithPrefixNoArgs()
        {
            var expected = ":jakub PING";

            var actual = new IrcMessage("PING", "jakub");
            Assert.AreEqual(expected, actual.ToString());
        }
开发者ID:jakubgarfield,项目名称:Bonobo-Irc-Library,代码行数:7,代码来源:IrcMessage.cs


注:本文中的IrcMessage.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。