public override object EditValue( ITypeDescriptorContext context, IServiceProvider provider, object value) { DataSourceProviderService dspService = (DataSourceProviderService)provider.GetService(typeof(DataSourceProviderService)); if (dspService == null || !dspService.SupportsAddNewDataSource) { using (GetTypeDialog dlg = new GetTypeDialog(provider, typeof(object), FilterTypeList)) { IWin32Window dialogOwnerWindow = null; IUIService uiService = (IUIService)provider.GetService(typeof(IUIService)); if (uiService != null) { dialogOwnerWindow = uiService.GetDialogOwnerWindow(); } DialogResult result = dlg.ShowDialog(dialogOwnerWindow); return(result == DialogResult.OK && dlg.ResultType != null? dlg.ResultType: value); } } return(new TypePicker().PickType(provider, value as Type, FilterTypeList)); }
private void addNewLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { GetTypeDialog dlg = new GetTypeDialog(_serviceProvider, typeof(object), _filter); DialogResult result = dlg.ShowDialog(); if (result == DialogResult.OK && dlg.ResultType != null) { _resultType = dlg.ResultType; SaveType(_resultType); _windowsFormsEditorService.CloseDropDown(); } }
public override object EditValue( ITypeDescriptorContext context, IServiceProvider provider, object value) { DataSourceProviderService dspService = (DataSourceProviderService)provider.GetService(typeof(DataSourceProviderService)); if (dspService == null || !dspService.SupportsAddNewDataSource) { GetTypeDialog dlg = new GetTypeDialog(provider, typeof(object), FilterTypeList); DialogResult result = dlg.ShowDialog(); return(result == DialogResult.OK && dlg.ResultType != null? dlg.ResultType: value); } return(new TypePicker().PickType(provider, value as Type, FilterTypeList)); }
private void addNewLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { using (GetTypeDialog dlg = new GetTypeDialog(_serviceProvider, typeof(object), _filter)) { IUIService uiService = GetService <IUIService>(); IWin32Window owner = uiService == null? null: uiService.GetDialogOwnerWindow(); DialogResult result = dlg.ShowDialog(owner); if (result == DialogResult.OK && dlg.ResultType != null) { _resultType = dlg.ResultType; SaveType(_resultType); _windowsFormsEditorService.CloseDropDown(); } } }
public override object EditValue( ITypeDescriptorContext context, IServiceProvider provider, object value) { DataSourceProviderService dspService = (DataSourceProviderService)provider.GetService(typeof(DataSourceProviderService)); if (dspService == null || !dspService.SupportsAddNewDataSource) { using (GetTypeDialog dlg = new GetTypeDialog(provider, typeof (object), FilterTypeList)) { IWin32Window dialogOwnerWindow = null; IUIService uiService = (IUIService)provider.GetService(typeof(IUIService)); if (uiService != null) dialogOwnerWindow = uiService.GetDialogOwnerWindow(); DialogResult result = dlg.ShowDialog(dialogOwnerWindow); return result == DialogResult.OK && dlg.ResultType != null? dlg.ResultType: value; } } return new TypePicker().PickType(provider, value as Type, FilterTypeList); }