• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IrcChannel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IrcChannel的典型用法代码示例。如果您正苦于以下问题:C# IrcChannel类的具体用法?C# IrcChannel怎么用?C# IrcChannel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IrcChannel类属于命名空间,在下文中一共展示了IrcChannel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: UIChannelConversation

 public UIChannelConversation(IrcChannelConversation conversation, IrcConversationProvider provider, UIServerConversation serverConversation)
 {
     _channel = conversation.Channel;
     _conversationProvider = provider;
     _serverConversation = serverConversation;
     conversation.Messages.CollectionChanged += new NotifyCollectionChangedEventHandler(Messages_CollectionChanged);
     _channel.People.CollectionChanged += new NotifyCollectionChangedEventHandler(People_CollectionChanged);
 }
开发者ID:jakubgarfield,项目名称:Bonobo-Irc-Library,代码行数:8,代码来源:UIChannelConversation.cs


示例2: Ban

 public void Ban(IrcChannel Channel, TimeSpan Time, params object[] Masks)
 {
     if (Masks.Length == 0)
         return;
     string flag = "+";
     foreach (string mask in Masks)
     {
         new UnbanTimer(Channel, mask, Time);
         flag += "b";
     }
     IrcClient.Send("MODE {0} {1} {2}", Channel, flag, Util.GetWords(Masks, 0));
 }
开发者ID:jaddie,项目名称:Werewolves-Irc-Bot,代码行数:12,代码来源:IrcCommandHandler.Actions.cs


示例3: AddChannelConversation

 public void AddChannelConversation(IrcChannel channel)
 {
     if (!ContainsChannelConversation(channel))
     {
         var conversation = new IrcChannelConversation(_session, channel);
         if (!_session.Channels.Contains(channel))
         {
             _session.Channels.Add(channel);
         }
         _session.Conversations.Add(conversation);
         channel.Join();
     }
 }
开发者ID:jakubgarfield,项目名称:Bonobo-Irc-Library,代码行数:13,代码来源:UIServerConversation.cs


示例4: HandleJoin

 public static void HandleJoin(IrcClient client, IrcMessage message)
 {
     if (client.User.Nick == new IrcUser(message.Prefix).Nick)
     {
         // We've joined this channel
         var channel = new IrcChannel(client, message.Parameters[0]);
         client.Channels.Add(channel);
     }
     else
     {
         // Someone has joined a channel we're already in
         client.Channels[message.Parameters[0]].Users.Add(new IrcUser(message.Prefix));
     }
     client.OnUserJoinedChannel(new ChannelUserEventArgs(client.Channels[message.Parameters[0]], new IrcUser(message.Prefix)));
 }
开发者ID:randacc,项目名称:ChatSharp,代码行数:15,代码来源:ChannelHandlers.cs


示例5: HandleGetTopic

 public static void HandleGetTopic(IrcClient client, IrcMessage message)
 {
     IrcChannel channel = null;
     string topic;
     if(client.Channels.Contains(message.Parameters[1])) {
         channel = client.Channels[message.Parameters[1]];
         topic = message.Parameters[2];
         channel.Topic = topic;
     }
     else {
         channel = new IrcChannel(client, message.Parameters[1]);
         topic = message.Parameters[2];
     }
     client.OnChannelTopicReceived(new ChannelTopicEventArgs(channel, topic));
 }
开发者ID:Roytazz,项目名称:TwitchLib,代码行数:15,代码来源:ChannelHandlers.cs


示例6: HandleJoin

 public static void HandleJoin(IrcClient client, IrcMessage message)
 {
     // Quick hack fix for issue #2
     if (message.Payload.StartsWith(":")) {
         message.Payload = message.Payload.Substring(1);
     }
     if (client.User.Nick == new IrcUser(message.Prefix).Nick)
     {
         // We've joined this channel
         var channel = new IrcChannel(client, message.Payload);
         client.Channels.Add(channel);
     }
     else
     {
         // Someone has joined a channel we're already in
         client.Channels[message.Payload].Users.Add(new IrcUser(message.Prefix));
     }
     client.OnUserJoinedChannel(new ChannelUserEventArgs(client.Channels[message.Payload], new IrcUser(message.Prefix)));
 }
开发者ID:angelog,项目名称:ChatSharp,代码行数:19,代码来源:ChannelHandlers.cs


示例7: AddChannelExecuted

 private void AddChannelExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     var txtChannel = (TextBox)((Grid)sender).FindName("txtChannel");
     if (!String.IsNullOrEmpty(txtChannel.Text))
     {
         var startChars = new char[] { '&', '#', '!', '+' };
         var serverCoversation = ((UIServerConversation)e.Parameter);
         var name = txtChannel.Text;
         if (!startChars.Contains(name[0]))
         {
             name = '#' + name;
         }
         var channel = new IrcChannel(serverCoversation.Session, name, String.Empty);
         if (serverCoversation.Session.Channels.Where(c => c.Name == name).Count() > 0)
         {
             channel = serverCoversation.Session.Channels.Where(c => c.Name == name).First();
         }
         serverCoversation.AddChannelConversation(channel);
     }
 }
开发者ID:jakubgarfield,项目名称:Bonobo-Irc-Library,代码行数:20,代码来源:IrcServerConversationTemplate.cs


示例8: WhoIsChannel

 private static void WhoIsChannel(IrcChannel channel, IrcClient client, int index)
 {
     // Note: joins and parts that happen during this will cause strange behavior here
     Thread.Sleep(client.Settings.JoinWhoIsDelay * 1000);
     var user = channel.Users[index];
     client.WhoIs(user.Nick, (whois) =>
         {
             user.User = whois.User.User;
             user.Hostname = whois.User.Hostname;
             user.RealName = whois.User.RealName;
             Task.Factory.StartNew(() => WhoIsChannel(channel, client, index + 1));
         });
 }
开发者ID:RockyTV,项目名称:ChatSharp,代码行数:13,代码来源:ChannelHandlers.cs


示例9: OnChannelUserJoined

 protected abstract void OnChannelUserJoined(IrcChannel channel, IrcChannelUserEventArgs e);
开发者ID:djeebus,项目名称:MusicHub,代码行数:1,代码来源:IrcBot.cs


示例10: ChannelUserEventArgs

 public ChannelUserEventArgs(IrcChannel channel, IrcUser user)
 {
     Channel = channel;
     User = user;
 }
开发者ID:randacc,项目名称:ChatSharp,代码行数:5,代码来源:ChannelUserEventArgs.cs


示例11: Unban

 public void Unban(IrcChannel Channel, string Masks)
 {
     Unban(Channel, Masks.Split(' '));
 }
开发者ID:jaddie,项目名称:WCell-Utility-Bot,代码行数:4,代码来源:IrcCommandHandler.cs


示例12: Mode

 public void Mode(IrcChannel Channel, string flags, params object[] Targets)
 {
     ircClient.Send("MODE " + Channel.Name + " " + flags + " " + Util.GetWords(Targets, 0));
 }
开发者ID:jaddie,项目名称:WCell-Utility-Bot,代码行数:4,代码来源:IrcCommandHandler.cs


示例13: KickBan

 public void KickBan(IrcChannel channel, TimeSpan time, params object[] masks)
 {
     Ban(channel, time, masks);
     foreach (string mask in masks)
     {
         foreach (IrcUser u in channel)
             if (u.Matches(mask))
                 Kick(channel, u);
     }
 }
开发者ID:jaddie,项目名称:WCell-Utility-Bot,代码行数:10,代码来源:IrcCommandHandler.cs


示例14: ParseModes

        internal void ParseModes(IrcUser user, IrcChannel chan, string flags, string[] args)
        {
            bool add = true;

            if (chan == null)
            {
                // User Modes
                for (int i = 0; i < flags.Length; i++)
                {
                    var c = Convert.ToString(flags[i]);
                    if (c == "+")
                    {
                        add = true;
                        continue;
                    }
                    else if (c == "-")
                    {
                        add = false;
                        continue;
                    }

                    if (add)
                        irc.Me.AddMode(c);
                    else
                        irc.Me.DeleteMode(c);
                    irc.UserModeChangedNotify();
                }
                return;
            }

            int n = 0;
            for (int i = 0; i < flags.Length; i++)
            {
                // Chan Modes/Flags
                var c = Convert.ToString(flags[i]);
                if (c == "+")
                {
                    add = true;
                    continue;
                }
                else if (c == "-")
                {
                    add = false;
                    continue;
                }

                var arg = "";

                if (irc.HasChanMode(c))
                {
                    // channel modes
                    if (add)
                    {
                        if (c == "b" || c == "k" || c == "l")
                            arg = args[n++];

                        if (c == "b")
                        {
                            var entry = new BanEntry(arg, user.Nick, DateTime.Now);
                            if (!chan.BanMasks.ContainsKey(arg))
                            {
                                chan.BanMasks.Add(arg, entry);
                            }
                        }
                        else
                        {
                            chan.AddMode(c, arg);
                        }
                        irc.ModeAddedNotify(user, chan, c, arg);
                    }
                    else
                    {
                        if (c == "b")
                        {
                            arg = args[n++];
                            chan.BanMasks.Remove(arg);
                        }
                        else
                        {
                            chan.DeleteMode(c);
                        }
                        irc.ModeDeletedNotify(user, chan, c, arg);
                    }
                }
                else
                {
                    // channel user flags
                    var priv = irc.GetPrivForFlag(flags[i]);
                    if (priv != Privilege.Regular)
                    {
                        arg = args[n++];
                        var targ = irc.GetOrCreateUser(arg);
                        if (add)
                        {
                            chan.AddFlag(priv, targ);
                            irc.FlagAddedNotify(user, chan, priv, targ);
                        }
                        else
                        {
                            chan.DeleteFlag(priv, targ);
//.........这里部分代码省略.........
开发者ID:WCell,项目名称:WCell-UtilityBot,代码行数:101,代码来源:IrcProtocolHandler.cs


示例15: ChannelEventArgs

 public ChannelEventArgs(IrcChannel channel)
 {
     Channel = channel;
 }
开发者ID:Luigifan,项目名称:Luigibot,代码行数:4,代码来源:ChannelEventArgs.cs


示例16: Kick

 public void Kick(IrcChannel Channel, IrcUser User, string reasonFormat, params object[] args)
 {
     Kick(Channel.Name, User.Nick, reasonFormat, args);
 }
开发者ID:jaddie,项目名称:WCell-Utility-Bot,代码行数:4,代码来源:IrcCommandHandler.cs


示例17: OnChannelNoticeReceived

 protected virtual void OnChannelNoticeReceived(IrcChannel channel, IrcMessageEventArgs e)
 {
 }
开发者ID:matthid,项目名称:ircdotnet,代码行数:3,代码来源:IrcBot.cs


示例18: OnChannelUserJoined

 protected virtual void OnChannelUserJoined(IrcChannel channel, IrcChannelUserEventArgs e)
 {
 }
开发者ID:matthid,项目名称:ircdotnet,代码行数:3,代码来源:IrcBot.cs


示例19: Part

 public void Part(IrcChannel chan, string reason, params object[] args)
 {
     ircClient.Send("PART " + chan.Name + " :" + String.Format(reason, args));
 }
开发者ID:jaddie,项目名称:WCell-Utility-Bot,代码行数:4,代码来源:IrcCommandHandler.cs


示例20: OnChannelUserLeft

 protected virtual void OnChannelUserLeft(IrcChannel channel, IrcChannelUserEventArgs e)
 {
 }
开发者ID:matthid,项目名称:ircdotnet,代码行数:3,代码来源:IrcBot.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IrcClient类代码示例发布时间:2022-05-24
下一篇:
C# IqType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap