public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService editorService = null; if (context != null && context.Instance != null && provider != null) { editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { CustomPropertyCollection cbx = (CustomPropertyCollection)context.Instance; OkCancelText rfc = new OkCancelText(); rfc.Texts = cbx[1].Value as Dictionary <string, string>; DialogResult result = rfc.ShowDialog(); if (result == DialogResult.OK) { value = rfc.Texts; return(value); } } } return(value); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService editorService = null; if (context != null && context.Instance != null && provider != null) { editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { CustomPropertyCollection cbx = (CustomPropertyCollection)context.Instance; RelationFieldChoose rfc = new RelationFieldChoose(editorService); rfc.strRField = (string)cbx[0].Value; rfc.pmsFieldList = (List <PmsField>)cbx[1].DefaultValue; rfc.CtrlType = (string)cbx[2].DefaultValue; editorService.DropDownControl(rfc); value = rfc.strRField; return(value); } } return(value); }