Beispiel #1
0
        /// <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);
                    }
                }
            }
        }
Beispiel #2
0
 public void SetSetting(object setting)
 {
     foreach (Control ctrl in Items)
     {
         ISettingView settingView = ctrl as ISettingView;
         if (settingView != null)
         {
             settingView.SetSetting(setting);
         }
     }
 }