public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (context.Instance is MpeControl) { try { MpeControl mpc = (MpeControl)context.Instance; IWindowsFormsEditorService editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); MpeTextAreaEditorForm selector = new MpeTextAreaEditorForm((string)value, editorService); editorService.DropDownControl(selector); if (selector.Result == DialogResult.Cancel) { return(value); } return(selector.TextValue); } catch (Exception ee) { MpeLog.Debug(ee); MpeLog.Error(ee); } } return(base.EditValue(context, provider, value)); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (context.Instance is MpeControl) { try { MpeControl mpc = (MpeControl) context.Instance; IWindowsFormsEditorService editorService = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); MpeTextAreaEditorForm selector = new MpeTextAreaEditorForm((string) value, editorService); editorService.DropDownControl(selector); if (selector.Result == DialogResult.Cancel) { return value; } return selector.TextValue; } catch (Exception ee) { MpeLog.Debug(ee); MpeLog.Error(ee); } } return base.EditValue(context, provider, value); }