Exemple #1
0
        public static IConfiguration GetConfig(IConfiguration deflt, ITriggerer trigger)
        {
            IConfiguration configuration;

            if (trigger.Text.NextModifiers() == "a")
            {
                string      shortName = trigger.Text.NextWord();
                IWCellAddon addon     = WCellAddonMgr.GetAddon(shortName);
                if (addon == null)
                {
                    trigger.Reply("Did not find any Addon matching: " + shortName);
                    return((IConfiguration)null);
                }

                configuration = addon.Config;
                if (configuration == null)
                {
                    trigger.Reply("Addon does not have a Configuration: " + (object)addon);
                    return((IConfiguration)null);
                }
            }
            else
            {
                configuration = deflt;
            }

            return(configuration);
        }
Exemple #2
0
        public static IConfiguration GetConfig(IConfiguration deflt, ITriggerer trigger)
        {
            IConfiguration cfg;

            if (trigger.Text.NextModifiers() == "a")
            {
                var shortName = trigger.Text.NextWord();
                var addon     = WCellAddonMgr.GetAddon(shortName);
                if (addon == null)
                {
                    trigger.Reply("Did not find any Addon matching: " + shortName);
                    return(null);
                }

                cfg = addon.Config;
                if (cfg == null)
                {
                    trigger.Reply("Addon does not have a Configuration: " + addon);
                    return(null);
                }
            }
            else
            {
                cfg = deflt;
            }
            return(cfg);
        }