public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if ((context != null) && (provider != null)) { _editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (_editorService != null) { foreach (Component component in context.Container.Components) { if (component != null) { if (component is NugenCCalcBase) { if ((component as NugenCCalcBase).FunctionParameters == (FunctionParameters)context.Instance) { context.OnComponentChanging(); if (component is NugenCCalc2D) { NugenCCalcDesignerForm designerForm = new NugenCCalcDesignerForm((component as NugenCCalc2D)); _editorService.ShowDialog(designerForm); } else { NugenCCalc3DDesignerForm designerForm = new NugenCCalc3DDesignerForm((component as NugenCCalc3D)); _editorService.ShowDialog(designerForm); } context.OnComponentChanged(); } } } } RefreshPropertyGrid(); } } return value; }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if ((context != null) && (provider != null)) { _editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (_editorService != null) { foreach (Component component in context.Container.Components) { if (component != null) { if (component is NugenCCalcBase) { if ((component as NugenCCalcBase).FunctionParameters == (FunctionParameters)context.Instance) { context.OnComponentChanging(); if (component is NugenCCalc2D) { NugenCCalcDesignerForm designerForm = new NugenCCalcDesignerForm((component as NugenCCalc2D)); _editorService.ShowDialog(designerForm); } else { NugenCCalc3DDesignerForm designerForm = new NugenCCalc3DDesignerForm((component as NugenCCalc3D)); _editorService.ShowDialog(designerForm); } context.OnComponentChanged(); } } } } RefreshPropertyGrid(); } } return(value); }