public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if ((context != null) && (provider != null)) { // Access the Property Browser's UI display service IWindowsFormsEditorService editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { // Create an instance of the UI editor form FillForm modalEditor = new FillForm(); // Pass the UI editor dialog the current property value modalEditor.Behavior = value as FillBehavior; // Display the UI editor dialog if (editorService.ShowDialog(modalEditor) == DialogResult.OK) { // Return the new property value from the UI editor form return modalEditor.Behavior; } } } return base.EditValue(context, provider, value); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if ((context != null) && (provider != null)) { // Access the Property Browser's UI display service IWindowsFormsEditorService editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { // Create an instance of the UI editor form FillForm modalEditor = new FillForm(); // Pass the UI editor dialog the current property value modalEditor.Behavior = value as FillBehavior; // Display the UI editor dialog if (editorService.ShowDialog(modalEditor) == DialogResult.OK) { // Return the new property value from the UI editor form return(modalEditor.Behavior); } } } return(base.EditValue(context, provider, value)); }