public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            var                    svc       = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            PropertyBag            bag       = (PropertyBag)context.Instance;
            string                 pName     = context.PropertyDescriptor.Name;
            PropertySpecDescriptor pd        = context.PropertyDescriptor as PropertySpecDescriptor;
            JSetting               setting   = pd.PropTag as JSetting;
            bool                   complated = false;
            object                 res       = AppManager.Instance.EditCustomSettingValue(setting, out complated, null);

            if (complated)
            {
                setting.ForceValueChangedEvent(this);
                bag.OnValueModified(null);
            }
            return(res);
        }
Exemple #2
0
 private void bag1_SetValue(object sender, PropertySpecEventArgs e)
 {
     try
     {
         if (e.Property.PropTag != null && e.Property.PropTag is JSetting)
         {
             JSetting setting = e.Property.PropTag as JSetting;
             if (setting.IsCustomSetting())
             {
             }
             else
             {
                 setting.Value = e.Value;
                 setting.ForceValueChangedEvent(this);
             }
         }
     }
     catch (Exception ex)
     {
         Log.ShowError(ex);
     }
 }