public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider != null) { editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { if (_mappingPropertyEditorForm == null) { _mappingPropertyEditorForm = new MappingPropertyEditorForm(); } _mappingPropertyEditorForm.Start(editorService, value); editorService.ShowDialog(_mappingPropertyEditorForm); if (_mappingPropertyEditorForm.DialogResult == DialogResult.OK) { MappingProperty mappingProperty = new MappingProperty(); mappingProperty.MappingInfoCollection = _mappingPropertyEditorForm.MappingInfoCollection; value = mappingProperty; } else { value = null; } } } return value; }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (provider != null) { editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { if (_mappingPropertyEditorForm == null) { _mappingPropertyEditorForm = new MappingPropertyEditorForm(); } _mappingPropertyEditorForm.Start(editorService, value); editorService.ShowDialog(_mappingPropertyEditorForm); if (_mappingPropertyEditorForm.DialogResult == DialogResult.OK) { MappingProperty mappingProperty = new MappingProperty(); mappingProperty.MappingInfoCollection = _mappingPropertyEditorForm.MappingInfoCollection; value = mappingProperty; } else { value = null; } } } return(value); }