/// <summary> /// Mediator set setting to all owned setting pages /// </summary> /// <param name="setting">The setting.</param> public void SetSetting(object setting) { if (setting == null) { return; } if (this.InvokeRequired) { VoidFunc <object> functor = this.SetSetting; this.Invoke(functor, setting); } else { if (_settingPagesMapping == null) { throw new Exception("Not initialized"); } foreach (Control ctrl in _settingPagesMapping.Values) { ISettingView settingCtrl = ctrl as ISettingView; if (settingCtrl != null) { settingCtrl.SetSetting(setting); } } } }
public void SetSetting(object setting) { foreach (Control ctrl in Items) { ISettingView settingView = ctrl as ISettingView; if (settingView != null) { settingView.SetSetting(setting); } } }