예제 #1
0
 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);
 }
예제 #2
0
        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);
                }
            }
        }