當前位置: 首頁>>代碼示例>>C#>>正文


C# config.containsUser方法代碼示例

本文整理匯總了C#中wmib.config.containsUser方法的典型用法代碼示例。如果您正苦於以下問題:C# config.containsUser方法的具體用法?C# config.containsUser怎麽用?C# config.containsUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wmib.config的用法示例。


在下文中一共展示了config.containsUser方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RetrieveStatus2

 public void RetrieveStatus2(string nick, config.channel channel, string source)
 {
     try
     {
         string response = "I have never seen " + nick;
         bool found = false;
         string action = "quiting the network";
         foreach (item xx in global)
         {
             if (nick.ToUpper() == xx.nick.ToUpper())
             {
                 found = true;
                 config.channel last;
                 switch (xx.LastAc)
                 {
                     case item.Action.Join:
                         action = "joining the channel";
                         last = core.getChannel(xx.lastplace);
                         if (last != null)
                         {
                             if (last.containsUser(nick))
                             {
                                 action += ", they are still in the channel";
                             }
                             else
                             {
                                 action += ", but they are not in the channel now and I don't know why, in";
                             }
                         }
                         break;
                     case item.Action.Kick:
                         action = "kicked from the channel";
                         break;
                     case item.Action.Nick:
                         if (xx.newnick == null)
                         {
                             action = "error NULL pointer at record";
                             break;
                         }
                         action = "changing the nickname to " + xx.newnick;
                         last = core.getChannel(xx.lastplace);
                         if (last.containsUser(xx.newnick))
                         {
                             action += " and " + xx.newnick + " is still in the channel";
                         }
                         else
                         {
                             action += ", but " + xx.newnick + " is no longer in channel";
                         }
                         item nick2 = getItem(xx.newnick);
                         if (nick2 != null)
                         {
                             TimeSpan span3 = DateTime.Now - nick2.LastSeen;
                             switch (nick2.LastAc)
                             {
                                 case item.Action.Exit:
                                     action += " because he quitted the network " + span3.ToString() + " ago. The nick change was done in";
                                     break;
                                 case item.Action.Kick:
                                     action += " because he was kicked from the channel " + span3.ToString() + " ago. The nick change was done in";
                                     break;
                                 case item.Action.Part:
                                     action += " because he left the channel " + span3.ToString() + " ago. The nick change was done in";
                                     break;
                             }
                         }
                         break;
                     case item.Action.Part:
                         action = "leaving the channel";
                         break;
                     case item.Action.Talk:
                         action = "talking in the channel";
                         last = core.getChannel(xx.lastplace);
                         if (last != null)
                         {
                             if (last.containsUser(nick))
                             {
                                 action += ", they are still in the channel";
                             }
                             else
                             {
                                 action += ", but they are not in the channel now and I don't know why, in";
                             }
                         }
                         break;
                     case item.Action.Exit:
                         string reason = xx.quit;
                         if (reason == "")
                         {
                             reason = "no reason was given";
                         }
                         action = "quitting the network with reason: " + reason;
                         break;
                 }
                 TimeSpan span = DateTime.Now - xx.LastSeen;
                 if (xx.LastAc == item.Action.Exit)
                 {
                     response = "Last time I saw " + nick + " they were " + action + " at " + xx.LastSeen.ToString() + " (" + span.ToString() + " ago)";
                 }
                 response = "Last time I saw " + nick + " they were " + action + " " + xx.lastplace + " at " + xx.LastSeen.ToString() + " (" + span.ToString() + " ago)";
//.........這裏部分代碼省略.........
開發者ID:reedy,項目名稱:wikimedia-bot,代碼行數:101,代碼來源:Seen.cs


注:本文中的wmib.config.containsUser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。