private void UpdatePlugins(string pluginName, TabPage page) { page.DoForEveryControl((Control c) => { if (c.GetType() == typeof(Label)) { return(true); } IPlugin curPlugin = GetPluginByName(pluginName); IFunction curFunction = null; if (curPlugin != null) { try { curFunction = (IFunction)curPlugin; } catch (Exception) { } } string SettingsKey = c.Tag.ToString(); if (c.GetType() == typeof(CheckBox)) { CheckBox cb = (CheckBox)c; if (curFunction != null) { curFunction.Settings.UpdateValue(SettingsKey, cb.Checked); } } return(true); }); }