public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (null == context) { return(value); } if (null == provider) { return(value); } IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (null == service) { return(null); } string currentProvider = ((IDatabaseProviderName)context.Instance).DatabaseProviderName; ProviderEditorUI control = new ProviderEditorUI(service, currentProvider); service.DropDownControl(control); if (control.SelectedProvider != null) { return(control.SelectedProvider); } return(value); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (null == context) return value; if (null == provider) return value; IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (null == service) return null; string currentProvider = ((IDatabaseProviderName)context.Instance).DatabaseProviderName; ProviderEditorUI control = new ProviderEditorUI(service, currentProvider); service.DropDownControl(control); if (control.SelectedProvider != null) { return control.SelectedProvider; } return value; }