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


C# config.RetrieveObject方法代码示例

本文整理汇总了C#中wmib.config.RetrieveObject方法的典型用法代码示例。如果您正苦于以下问题:C# config.RetrieveObject方法的具体用法?C# config.RetrieveObject怎么用?C# config.RetrieveObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wmib.config的用法示例。


在下文中一共展示了config.RetrieveObject方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Hook_Channel

 public override void Hook_Channel(config.channel channel)
 {
     if (channel.RetrieveObject("Statistics") == null)
     {
         channel.RegisterObject(new Statistics(channel), NAME);
     }
 }
开发者ID:atdt,项目名称:wikimedia-bot,代码行数:7,代码来源:Statistics.cs

示例2: Hook_Channel

 public override void Hook_Channel(config.channel channel)
 {
     if (channel.RetrieveObject("rss") == null)
     {
         channel.RegisterObject(new Feed(channel), "rss");
     }
 }
开发者ID:atdt,项目名称:wikimedia-bot,代码行数:7,代码来源:Module.cs

示例3: Extension_DumpHtml

 public override string Extension_DumpHtml(config.channel channel)
 {
     string HTML = "";
     if (GetConfig(channel, "Rss.Enable", false))
     {
         Feed list = (Feed)channel.RetrieveObject("rss");
         if (list == null)
         {
             return "";
         }
         if (GetConfig(channel, "Rss.Enable", false) != true)
         {
             return HTML;
         }
         HTML += "<h4>Rss feed</h4><br>";
         HTML += "\n<br>\n<h4>Rss</h4>\n<br>\n\n<table class=\"infobot\" width=100% border=1>";
         HTML += "<tr><th>Name</th><th>URL</th><th>Text</th><th>Enabled</th></tr>";
         lock (list.Content)
         {
             foreach (Feed.item feed in list.Content)
             {
                 HTML += "\n<tr><td>" + feed.name + "</td><td><a href=\"" + feed.URL + "\">" + feed.URL + "</a></td><td>" + feed.message + "</td><td>" + (!feed.disabled).ToString() + "</td></tr>";
             }
         }
         HTML += "</table>\n";
     }
     return HTML;
 }
开发者ID:atdt,项目名称:wikimedia-bot,代码行数:28,代码来源:Module.cs

示例4: Hook_Channel

 public override void Hook_Channel(config.channel channel)
 {
     if (channel.RetrieveObject("RC") == null)
     {
         channel.RegisterObject(new RecentChanges(channel), "RC");
     }
 }
开发者ID:reedy,项目名称:wikimedia-bot,代码行数:7,代码来源:RegularModule.cs

示例5: Extension_DumpHtml

 public override string Extension_DumpHtml(config.channel channel)
 {
     string HTML = "";
     if (Module.GetConfig(channel, "Statistics.Enabled", false))
     {
         Statistics list = (Statistics)channel.RetrieveObject(NAME);
         if (list != null)
         {
             HTML += "\n<br>\n<h4>Most active users :)</h4>\n<br>\n\n<table class=\"infobot\" width=100% border=1>";
             HTML += "<tr><td>N.</td><th>Nick</th><th>Messages (average / day)</th><th>Number of posted messages</th><th>Active since</th></tr>";
             int id = 0;
             int totalms = 0;
             DateTime startime = DateTime.Now;
             lock (list.data)
             {
                 list.data.Sort();
                 list.data.Reverse();
                 foreach (Statistics.list user in list.data)
                 {
                     id++;
                     totalms += user.messages;
                     if (id > 100)
                     {
                         continue;
                     }
                     if (startime > user.logging_since)
                     {
                         startime = user.logging_since;
                     }
                     System.TimeSpan uptime = System.DateTime.Now - user.logging_since;
                     float average = user.messages;
                     average = ((float)user.messages / (float)(uptime.Days + 1));
                     if (user.URL != "")
                     {
                         HTML += "<tr><td>" + id.ToString() + ".</td><td><a target=\"_blank\" href=\"" + user.URL + "\">" + user.user + "</a></td><td>" + average.ToString() + "</td><td>" + user.messages.ToString() + "</td><td>" + user.logging_since.ToString() + "</td></tr>";
                     }
                     else
                     {
                         HTML += "<tr><td>" + id.ToString() + ".</td><td>" + user.user + "</td><td>" + average.ToString() + "</td><td>" + user.messages.ToString() + "</td><td>" + user.logging_since.ToString() + "</td></tr>";
                     }
                     HTML += "  \n";
                 }
             }
             System.TimeSpan uptime_total = System.DateTime.Now - startime;
             float average2 = totalms;
             average2 = (float)totalms / (1 + uptime_total.Days);
             HTML += "<tr><td>N/A</td><th>Total:</th><th>" + average2.ToString() + "</th><th>" + totalms.ToString() + "</th><td>N/A</td></tr>";
             HTML += "  \n";
             HTML += "</table>";
         }
     }
     return HTML;
 }
开发者ID:atdt,项目名称:wikimedia-bot,代码行数:53,代码来源:Statistics.cs

示例6: Extension_DumpHtml

        public override string Extension_DumpHtml(config.channel channel)
        {
            string HTML = "";

            if (GetConfig(channel, "RC.Enabled", false))
            {
                RecentChanges rc = (RecentChanges)channel.RetrieveObject("RC");
                if (rc != null)
                {
                    HTML = rc.ToTable();
                }
            }
            return HTML;
        }
开发者ID:reedy,项目名称:wikimedia-bot,代码行数:14,代码来源:RegularModule.cs

示例7: Extension_DumpHtml

 public override string Extension_DumpHtml(config.channel channel)
 {
     string HTML = "";
     infobot_core info = (infobot_core)channel.RetrieveObject("Infobot");
     if (info != null)
     {
         HTML += "\n<table border=1 class=\"infobot\" width=100%>\n<tr><th width=10%>Key</th><th>Value</th></tr>\n";
         List<infobot_core.InfobotKey> list = new List<infobot_core.InfobotKey>();
         info.locked = true;
         lock (info.Keys)
         {
             if (Module.GetConfig(channel, "Infobot.Sorted", false) != false)
             {
                 list = info.SortedItem();
             }
             else
             {
                 list.AddRange(info.Keys);
             }
         }
         if (info.Keys.Count > 0)
         {
             foreach (infobot_core.InfobotKey Key in list)
             {
                 HTML += core.HTML.AddKey(Key.Key, Key.Text);
             }
         }
         HTML += "</table>\n";
         HTML += "<h4>Aliases</h4>\n<table class=\"infobot\" border=1 width=100%>\n";
         lock (info.Alias)
         {
             foreach (infobot_core.InfobotAlias data in info.Alias)
             {
                 HTML += core.HTML.AddLink(data.Name, data.Key);
             }
         }
         HTML += "</table><br>\n";
         info.locked = false;
     }
     return HTML;
 }
开发者ID:atdt,项目名称:wikimedia-bot,代码行数:41,代码来源:Plugin.cs

示例8: Hook_PRIV

        public override void Hook_PRIV(config.channel channel, User invoker, string message)
        {
            if (message.StartsWith(config.CommandPrefix + "RC-"))
            {
                if (channel.Users.IsApproved(invoker, "trust"))
                {
                    if (GetConfig(channel, "RC.Enabled", false))
                    {
                        string[] a = message.Split(' ');
                        if (a.Length < 3)
                        {
                            core.irc._SlowQueue.DeliverMessage(messages.get("Feed8", channel.Language, new List<string> { invoker.Nick }), channel.Name);
                            return;
                        }
                        string wiki = a[1];
                        string Page = a[2];
                        RecentChanges rc = (RecentChanges)channel.RetrieveObject("RC");
                        if (rc != null)
                        {
                            rc.removeString(wiki, Page);
                        }
                        return;
                    }
                    else
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("Feed3", channel.Language), channel.Name);
                        return;
                    }
                }
                if (!channel.suppress_warnings)
                {
                    core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                }
                return;
            }

            if (message.StartsWith(config.CommandPrefix + "recentchanges- "))
            {
                if (channel.Users.IsApproved(invoker, "root"))
                {
                    if (GetConfig(channel, "RC.Enabled", false))
                    {
                        if (!message.Contains(" "))
                        {
                            if (!channel.suppress_warnings)
                            {
                                core.irc._SlowQueue.DeliverMessage(messages.get("InvalidWiki", channel.Language), channel.Name);
                            }
                            return;
                        }
                        string _channel = message.Substring(message.IndexOf(" ") + 1);
                        if (RecentChanges.DeleteChannel(channel, _channel))
                        {
                            core.irc._SlowQueue.DeliverMessage(messages.get("Wiki-", channel.Language), channel.Name, IRC.priority.high);
                        }
                        return;
                    }
                    else
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("Feed3", channel.Language), channel.Name);
                        return;
                    }
                }
                if (!channel.suppress_warnings)
                {
                    core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                }
                return;
            }

            if (message.StartsWith(config.CommandPrefix + "RC+ "))
            {
                if (channel.Users.IsApproved(invoker, "trust"))
                {
                    if (GetConfig(channel, "RC.Enabled", false))
                    {
                        string[] a = message.Split(' ');
                        if (a.Length < 3)
                        {
                            core.irc._SlowQueue.DeliverMessage(messages.get("Feed4", channel.Language) + invoker.Nick + messages.get("Feed5", channel.Language), channel.Name);
                            return;
                        }
                        string wiki = a[1];
                        string Page = a[2];
                        RecentChanges rc = (RecentChanges)channel.RetrieveObject("RC");
                        if (rc != null)
                        {
                            rc.insertString(wiki, Page);
                        }
                        return;
                    }
                    else
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("Feed3", channel.Language), channel.Name);
                        return;
                    }
                }
                if (!channel.suppress_warnings)
                {
                    core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
//.........这里部分代码省略.........
开发者ID:Krenair,项目名称:wikimedia-bot,代码行数:101,代码来源:RegularModule.cs

示例9: Hook_Channel

 public override void Hook_Channel(config.channel channel)
 {
     core.Log("Loading " + channel.Name);
     if (channel == null)
     {
         core.Log("NULL");
     }
     if (Snapshots)
     {
         try
         {
             if (Directory.Exists(SnapshotsDirectory + Path.DirectorySeparatorChar + channel.Name) == false)
             {
                 core.Log("Creating directory for infobot for " + channel.Name);
                 Directory.CreateDirectory(SnapshotsDirectory + Path.DirectorySeparatorChar + channel.Name);
             }
         }
         catch (Exception fail)
         {
             core.handleException(fail);
         }
     }
     if (channel.RetrieveObject("Infobot") == null)
     {
         // sensitivity
         bool cs = Module.GetConfig(channel, "Infobot.Case", true);
         channel.RegisterObject(new infobot_core(getDB(ref channel), channel.Name, cs), "Infobot");
     }
 }
开发者ID:reedy,项目名称:wikimedia-bot,代码行数:29,代码来源:Plugin.cs

示例10: Hook_SetConfig

 public override bool Hook_SetConfig(config.channel chan, User invoker, string config, string value)
 {
     bool _temp_a;
     switch (config)
     {
         case "infobot-trim-white-space-in-name":
             if (bool.TryParse(value, out _temp_a))
             {
                 Module.SetConfig(chan, "Infobot.Trim-white-space-in-name", _temp_a);
                 core.irc._SlowQueue.DeliverMessage(messages.get("configuresave", chan.Language, new List<string> { value, config }), chan.Name);
                 chan.SaveConfig();
                 return true;
             }
             core.irc._SlowQueue.DeliverMessage(messages.get("configure-va", chan.Language, new List<string> { config, value }), chan.Name);
             return true;
         case "infobot-auto-complete":
             if (bool.TryParse(value, out _temp_a))
             {
                 Module.SetConfig(chan, "Infobot.auto-complete", _temp_a);
                 core.irc._SlowQueue.DeliverMessage(messages.get("configuresave", chan.Language, new List<string> { value, config }), chan.Name);
                 chan.SaveConfig();
                 return true;
             }
             core.irc._SlowQueue.DeliverMessage(messages.get("configure-va", chan.Language, new List<string> { config, value }), chan.Name);
             return true;
         case "infobot-sorted":
             if (bool.TryParse(value, out _temp_a))
             {
                 Module.SetConfig(chan, "Infobot.Sorted", _temp_a);
                 core.irc._SlowQueue.DeliverMessage(messages.get("configuresave", chan.Language, new List<string> { value, config }), chan.Name);
                 chan.SaveConfig();
                 return true;
             }
             core.irc._SlowQueue.DeliverMessage(messages.get("configure-va", chan.Language, new List<string> { config, value }), chan.Name);
             return true;
         case "infobot-help":
             if (bool.TryParse(value, out _temp_a))
             {
                 Module.SetConfig(chan, "Infobot.Help", _temp_a);
                 core.irc._SlowQueue.DeliverMessage(messages.get("configuresave", chan.Language, new List<string> { value, config }), chan.Name);
                 chan.SaveConfig();
                 return true;
             }
             core.irc._SlowQueue.DeliverMessage(messages.get("configure-va", chan.Language, new List<string> { config, value }), chan.Name);
             return true;
         case "infobot-case":
             if (bool.TryParse(value, out _temp_a))
             {
                 Module.SetConfig(chan, "Infobot.Case", _temp_a);
                 core.irc._SlowQueue.DeliverMessage(messages.get("configuresave", chan.Language, new List<string> { value, config }), chan.Name);
                 chan.SaveConfig();
                 infobot_core infobot = (infobot_core)chan.RetrieveObject("Infobot");
                 if (infobot != null)
                 {
                     infobot.Sensitive = _temp_a;
                 }
                 return true;
             }
             core.irc._SlowQueue.DeliverMessage(messages.get("configure-va", chan.Language, new List<string> { config, value }), chan.Name);
             return true;
     }
     return false;
 }
开发者ID:reedy,项目名称:wikimedia-bot,代码行数:63,代码来源:Plugin.cs

示例11: Hook_PRIV

        public override void Hook_PRIV(config.channel channel, User invoker, string message)
        {
            // "\uff01" is the full-width version of "!".
            if ((message.StartsWith("!") || message.StartsWith("\uff01")) && GetConfig(channel, "Infobot.Enabled", true))
            {
                while (Unwritable)
                {
                    Thread.Sleep(10);
                }
                Unwritable = true;
                infobot_core.InfoItem item = new infobot_core.InfoItem();
                item.Channel = channel;
                item.Name = "!" + message.Substring(1); // Normalizing "!".
                item.User = invoker.Nick;
                item.Host = invoker.Host;
                jobs.Add(item);
                Unwritable = false;
            }

            infobot_core infobot = null;

            if (message.StartsWith("@"))
            {
                infobot = (infobot_core)channel.RetrieveObject("Infobot");
                if (infobot == null)
                {
                    core.Log("Object Infobot in " + channel.Name + " doesn't exist", true);
                }
                if (GetConfig(channel, "Infobot.Enabled", true))
                {
                    if (infobot != null)
                    {
                        infobot.Find(message, channel);
                        infobot.RSearch(message, channel);
                    }
                }
            }

            if (Snapshots)
            {
                if (message.StartsWith("@infobot-recovery "))
                {
                    if (channel.Users.isApproved(invoker.Nick, invoker.Host, "admin"))
                    {
                        string name = message.Substring("@infobot-recovery ".Length);
                        if (!GetConfig(channel, "Infobot.Enabled", true))
                        {
                            core.irc._SlowQueue.DeliverMessage("Infobot is not enabled in this channel", channel.Name, IRC.priority.low);
                            return;
                        }
                        if (infobot != null)
                        {
                            infobot.RecoverSnapshot(channel, name);
                        }
                        return;
                    }
                    if (!channel.suppress_warnings)
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                    }
                    return;
                }

                if (message.StartsWith("@infobot-snapshot "))
                {
                    if (channel.Users.isApproved(invoker.Nick, invoker.Host, "admin"))
                    {
                        string name = message.Substring("@infobot-snapshot ".Length);
                        if (!GetConfig(channel, "Infobot.Enabled", true))
                        {
                            core.irc._SlowQueue.DeliverMessage("Infobot is not enabled in this channel", channel.Name, IRC.priority.low);
                            return;
                        }
                        if (infobot != null)
                        {
                            infobot.CreateSnapshot(channel, name);
                        }
                        return;
                    }
                    if (!channel.suppress_warnings)
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                    }
                    return;
                }

                if (message.StartsWith("@infobot-set-raw "))
                {
                    if (channel.Users.isApproved(invoker.Nick, invoker.Host, "trust"))
                    {
                        string name = message.Substring("@infobot-set-raw ".Length);
                        if (!GetConfig(channel, "Infobot.Enabled", true))
                        {
                            core.irc._SlowQueue.DeliverMessage("Infobot is not enabled in this channel", channel.Name, IRC.priority.low);
                            return;
                        }
                        if (infobot != null)
                        {
                            infobot.setRaw(name, invoker.Nick, channel);
                            return;
//.........这里部分代码省略.........
开发者ID:reedy,项目名称:wikimedia-bot,代码行数:101,代码来源:Plugin.cs

示例12: Hook_PRIV

        public override void Hook_PRIV(config.channel channel, User invoker, string message)
        {
            if (Module.GetConfig(channel, "Statistics.Enabled", false))
            {
                Statistics st = (Statistics)channel.RetrieveObject("Statistics");
                if (st != null)
                {
                    st.Stat(invoker.Nick, message, invoker.Host);
                }
            }

            if (message == "@statistics-off")
            {
                if (channel.Users.isApproved(invoker.Nick, invoker.Host, "admin"))
                {
                    if (!Module.GetConfig(channel, "Statistics.Enabled", false))
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("StatE2", channel.Language), channel.Name);
                        return;
                    }
                    else
                    {
                        Module.SetConfig(channel, "Statistics.Enabled", false);
                        channel.SaveConfig();
                        core.irc._SlowQueue.DeliverMessage(messages.get("Stat-off", channel.Language), channel.Name);
                        return;
                    }
                }
                if (!channel.suppress_warnings)
                {
                    core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                }
                return;
            }

            if (message == "@statistics-reset")
            {
                if (channel.Users.isApproved(invoker.Nick, invoker.Host, "admin"))
                {
                    Statistics st = (Statistics)channel.RetrieveObject("Statistics");
                    if (st != null)
                    {
                        st.Delete();
                    }
                    core.irc._SlowQueue.DeliverMessage(messages.get("Statdt", channel.Language), channel.Name);
                    return;
                }
                if (!channel.suppress_warnings)
                {
                    core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                }
                return;
            }

            if (message == "@statistics-on")
            {
                if (channel.Users.isApproved(invoker.Nick, invoker.Host, "admin"))
                {
                    if (Module.GetConfig(channel, "Statistics.Enabled", false))
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("StatE1", channel.Language), channel.Name);
                        return;
                    }
                    else
                    {
                        Module.SetConfig(channel, "Statistics.Enabled", true);
                        channel.SaveConfig();
                        core.irc._SlowQueue.DeliverMessage(messages.get("Stat-on", channel.Language), channel.Name);
                        return;
                    }
                }
                if (!channel.suppress_warnings)
                {
                    core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                }
                return;
            }
        }
开发者ID:atdt,项目名称:wikimedia-bot,代码行数:78,代码来源:Statistics.cs

示例13: Hook_PRIV

        public override void Hook_PRIV(config.channel channel, User invoker, string message)
        {
            if (message.StartsWith("@rss- "))
            {
                if (channel.Users.isApproved(invoker.Nick, invoker.Host, "trust"))
                {
                    string item = message.Substring("@rss+ ".Length);
                    Feed feed = (Feed)channel.RetrieveObject("rss");
                    if (feed != null)
                    {
                        feed.RemoveItem(item);
                    }
                    return;
                }
                else
                {
                    if (!channel.suppress_warnings)
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                    }
                }
            }

            if (message.StartsWith("@rss-setstyle "))
            {
                if (channel.Users.isApproved(invoker.Nick, invoker.Host, "trust"))
                {
                    string item = message.Substring("@rss-setstyle ".Length);
                    if (item.Contains(" "))
                    {
                        string id = item.Substring(0, item.IndexOf(" "));
                        string ur = item.Substring(item.IndexOf(" ") + 1);
                        Feed feed = (Feed)channel.RetrieveObject("rss");
                        if (feed != null)
                        {
                            feed.StyleItem(id, ur);
                        }
                        return;
                    }
                    if (item != "")
                    {
                        Feed feed = (Feed)channel.RetrieveObject("rss");
                        if (feed != null)
                        {
                            feed.StyleItem(item, "");
                        }
                        return;
                    }
                    if (!channel.suppress_warnings)
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("Rss5", channel.Language), channel.Name, IRC.priority.low);
                    }
                }
                else
                {
                    if (!channel.suppress_warnings)
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                    }
                }
            }

            if (message.StartsWith("@rss+ "))
            {
                if (channel.Users.isApproved(invoker.Nick, invoker.Host, "trust"))
                {
                    string item = message.Substring("@rss+ ".Length);
                    if (item.Contains(" "))
                    {
                        string id = item.Substring(0, item.IndexOf(" "));
                        string ur = item.Substring(item.IndexOf(" ") + 1);
                        Feed feed = (Feed)channel.RetrieveObject("rss");
                        if (feed != null)
                        {
                            feed.InsertItem(id, ur);
                        }
                        return;
                    }
                    if (item != "")
                    {
                        Feed feed = (Feed)channel.RetrieveObject("rss");
                        if (feed != null)
                        {
                            feed.InsertItem(item, "");
                        }
                        return;
                    }
                    if (!channel.suppress_warnings)
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("Rss5", channel.Language), channel.Name, IRC.priority.low);
                    }
                }
                else
                {
                    if (!channel.suppress_warnings)
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                    }
                }
            }
//.........这里部分代码省略.........
开发者ID:atdt,项目名称:wikimedia-bot,代码行数:101,代码来源:Module.cs

示例14: Hook_PRIV

        public override void Hook_PRIV(config.channel channel, User invoker, string message)
        {
            if (message.StartsWith("@rss- "))
            {
                if (channel.Users.IsApproved(invoker, "trust"))
                {
                    string item = message.Substring("@rss+ ".Length);
                    Feed feed = (Feed)channel.RetrieveObject("rss");
                    if (feed != null)
                    {
                        feed.RemoveItem(item);
                    }
                    return;
                }
                else
                {
                    if (!channel.suppress_warnings)
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                    }
                }
            }

            if (message.StartsWith("@rss-setstyle "))
            {
                if (channel.Users.IsApproved(invoker, "trust"))
                {
                    string item = message.Substring("@rss-setstyle ".Length);
                    if (item.Contains(" "))
                    {
                        string id = item.Substring(0, item.IndexOf(" "));
                        string ur = item.Substring(item.IndexOf(" ") + 1);
                        Feed feed = (Feed)channel.RetrieveObject("rss");
                        if (feed != null)
                        {
                            feed.StyleItem(id, ur);
                        }
                        return;
                    }
                    if (item != "")
                    {
                        Feed feed = (Feed)channel.RetrieveObject("rss");
                        if (feed != null)
                        {
                            feed.StyleItem(item, "");
                        }
                        return;
                    }
                    if (!channel.suppress_warnings)
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("Rss5", channel.Language), channel.Name, IRC.priority.low);
                    }
                }
                else
                {
                    if (!channel.suppress_warnings)
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel.Name, IRC.priority.low);
                    }
                }
            }

            if (message.StartsWith(config.CommandPrefix + "rss-search+ "))
            {
                if (channel.Users.IsApproved(invoker, "trust"))
                {
                    string item = message.Substring("@rss-search+ ".Length);
                    Feed feed = (Feed)channel.RetrieveObject("rss");
                    if (feed != null)
                    {
                        lock (feed.ScannerMatches)
                        {
                            if (feed.ScannerMatches.Contains(item))
                            {
                                core.irc._SlowQueue.DeliverMessage("This item is already being searched", channel);
                                return;
                            }
                            core.irc._SlowQueue.DeliverMessage("This item is now searched", channel);
                            feed.ScannerMatches.Add(item);
                            return;
                        }
                    }
                    core.irc._SlowQueue.DeliverMessage("Error, this channel doesn't have RC feed", channel);
                    return;
                }
                else
                {
                    if (!channel.suppress_warnings)
                    {
                        core.irc._SlowQueue.DeliverMessage(messages.get("PermissionDenied", channel.Language), channel, IRC.priority.low);
                    }
                }
            }

            if (message.StartsWith(config.CommandPrefix + "rss-search- "))
            {
                if (channel.Users.IsApproved(invoker, "trust"))
                {
                    string item = message.Substring("@rss-search+ ".Length);
                    Feed feed = (Feed)channel.RetrieveObject("rss");
//.........这里部分代码省略.........
开发者ID:Krenair,项目名称:wikimedia-bot,代码行数:101,代码来源:Module.cs


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