public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (context != null && provider != null && context.Instance != null) { MathematicExpression me = context.Instance as MathematicExpression; if (me != null) { Form f = me.FindForm(); if (f != null) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc != null) { DlgSelectProperty dlg = new DlgSelectProperty(); dlg.LoadData(f); if (edSvc.ShowDialog(dlg) == DialogResult.OK) { value = dlg.SelectedProperty; } } } } } return(value); }
public void SelectVariableValue(string name) { Form f = this.FindForm(); if (f != null) { DlgSelectProperty dlg = new DlgSelectProperty(); dlg.LoadData(f); if (dlg.ShowDialog(f) == DialogResult.OK) { SetVariable(name, dlg.SelectedProperty); } } }