public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (!provider.TryGetService(out IWindowsFormsEditorService editorService)) { return(value); } using (DateTimeUI dateTimeUI = new DateTimeUI()) { dateTimeUI.Start(editorService, value); editorService.DropDownControl(dateTimeUI); value = dateTimeUI.Value; dateTimeUI.End(); } return(value); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider != null) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc == null) { return value; } using (DateTimeUI eui = new DateTimeUI()) { eui.Start(edSvc, value); edSvc.DropDownControl(eui); value = eui.Value; eui.End(); } } return value; }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider != null) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc == null) { return(value); } using (DateTimeUI eui = new DateTimeUI()) { eui.Start(edSvc, value); edSvc.DropDownControl(eui); value = eui.Value; eui.End(); } } return(value); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider is null) { return(value); } IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc is null) { return(value); } using (DateTimeUI dateTimeUI = new DateTimeUI()) { dateTimeUI.Start(edSvc, value); edSvc.DropDownControl(dateTimeUI); value = dateTimeUI.Value; dateTimeUI.End(); } return(value); }