Esempio n. 1
0
        public void LoadSettings(object[] prefs)
        {
            if (prefs == null)
            {
                return;
            }

            foreach (object o in prefs)
            {
                PrefsKeyPair p = o as PrefsKeyPair;
                if (p == null)
                {
                    continue;
                }

                switch (p.Name.ToLower())
                {
                case "enabled":
                    PluginEnabled = Settings.Enabled = (bool)p.Setting;
                    break;

                case "skip":
                    Settings.Skip = (bool)p.Setting;
                    break;

                case "appendtoeditsummary":
                    Settings.AppendToEditSummary = (bool)p.Setting;
                    break;
                }
                // Settings.Categories = (Dictionary<string, string>)pkp.Setting;
            }
        }
Esempio n. 2
0
        public void LoadSettings(object[] prefs)
        {
            if (prefs == null)
            {
                return;
            }

            foreach (object o in prefs)
            {
                PrefsKeyPair p = o as PrefsKeyPair;
                if (p == null)
                {
                    continue;
                }

                switch (p.Name.ToLower())
                {
                case "enabled":
                    PluginEnabled = Settings.Enabled = (bool)p.Setting;
                    break;

                case "comment":
                    Settings.Comment = (bool)p.Setting;
                    break;

                case "skip":
                    Settings.Skip = (bool)p.Setting;
                    break;
                }
            }
            //Settings.Images = (Dictionary<string, string>)pkp.Setting;
        }
Esempio n. 3
0
        public void LoadSettings(object[] prefs)
        {
            if (prefs == null)
            {
                return;
            }

            foreach (object o in prefs)
            {
                PrefsKeyPair p = o as PrefsKeyPair;
                if (p == null)
                {
                    continue;
                }

                switch (p.Name.ToLower())
                {
                case "enabled":
                    PluginEnabled = Settings.Enabled = (bool)p.Setting;
                    break;

                case "enabledfilenames":
                    Settings.EnabledFilenames = (List <string>)p.Setting;
                    break;
                }
            }
        }
Esempio n. 4
0
        public object[] SaveSettings()
        {
            Settings.Enabled = PluginEnabled;

            PrefsKeyPair[] prefs = new PrefsKeyPair[2];
            prefs[0] = new PrefsKeyPair("Enabled", Settings.Enabled);
            prefs[1] = new PrefsKeyPair("EnabledFilenames", Settings.EnabledFilenames);

            return(prefs);
        }
Esempio n. 5
0
 void IAWBPlugin.LoadSettings(object[] prefs)
 {
     if (prefs != null && prefs[0] is PrefsKeyPair)
     {
         PrefsKeyPair pref = (prefs[0] as PrefsKeyPair);
         if ((pref != null) && pref.Name == "Enabled")
         {
             ServerUserControl.PluginEnabled = (bool)pref.Setting;
         }
     }
 }
Esempio n. 6
0
        public object[] SaveSettings()
        {
            Settings.Enabled = PluginEnabled;

            PrefsKeyPair[] prefs = new PrefsKeyPair[2];
            prefs[0] = new PrefsKeyPair("Enabled", Settings.Enabled);
            prefs[1] = new PrefsKeyPair("Skip", Settings.Skip);
            //prefs[3] = new PrefsKeyPair("categories", Settings.Images);

            return(prefs);
        }
Esempio n. 7
0
        public object[] SaveSettings()
        {
            Settings.Enabled = PluginEnabled;

            PrefsKeyPair[] prefs = new PrefsKeyPair[3];
            prefs[0] = new PrefsKeyPair("Enabled", Settings.Enabled);
            prefs[1] = new PrefsKeyPair("Comment", Settings.Comment);
            prefs[2] = new PrefsKeyPair("Skip", Settings.Skip);
            //prefs[3] = new PrefsKeyPair("images", Settings.Images);

            return prefs;
        }
Esempio n. 8
0
        public void LoadSettings(object[] prefs)
        {
            Reset();
            if (prefs == null)
            {
                return;
            }

            foreach (object o in prefs)
            {
                PrefsKeyPair p = o as PrefsKeyPair;
                if (p == null)
                {
                    continue;
                }

                switch (p.Name.ToLower())
                {
                case "enabled":
                    Enabled = (bool)p.Setting;
                    break;

                case "link":
                    Link = (string)p.Setting;
                    break;

                case "skip":
                    Skip = (bool)p.Setting;
                    break;

                case "removeemptiedsections":
                    RemoveEmptiedSections = (bool)p.Setting;
                    break;
                }

                GenerateRegexes();
            }
        }
Esempio n. 9
0
        public void LoadSettings(object[] prefs)
        {
            if (prefs == null)
            {
                return;
            }
            Settings              = defaultSettings;
            Settings.Parameters   = new Dictionary <string, string>();
            Settings.Replacements = new Dictionary <string, string>();

            foreach (object o in prefs)
            {
                PrefsKeyPair p = o as PrefsKeyPair;
                if (p == null)
                {
                    continue;
                }

                switch (p.Name.ToLower())
                {
                case "enabled":
                    Settings.Enabled = (bool)p.Setting;
#if SHORT_PLUGIN_MENU
                    pluginMenuItem.Checked = Settings.Enabled;
#else
                    pluginEnabledMenuItem.Checked = Settings.Enabled;
#endif
                    break;

                case "xspipes":
                    Settings.RemoveExcessPipes = (bool)p.Setting;
                    break;

                case "skip":
                    Settings.SkipIfNoTemplates = (bool)p.Setting;
                    break;

                case "template":
                    Settings.TemplateName = (string)p.Setting;
                    break;

                case "dlgwidth":
                    Settings.dlgWidth = (int)p.Setting;
                    break;

                case "dlgheight":
                    Settings.dlgHeight = (int)p.Setting;
                    break;

                case "dlgcol0":
                    Settings.dlgCol0 = (int)p.Setting;
                    break;

                case "dlgcol1":
                    Settings.dlgCol1 = (int)p.Setting;
                    break;

                default:
                    if (p.Name.StartsWith(":"))
                    {
                        Settings.Parameters[p.Name.Substring(1)] = (string)p.Setting;
                    }
                    else if (p.Name.StartsWith(";"))
                    {
                        Settings.Replacements[p.Name.Substring(1)] = (string)p.Setting;
                    }
                    break;
                }
            }
            RegexString = ""; // force the main regex to be evaluated on next use
        }