public IDataSelectionControl GetUIEditorModal(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (edSvc != null)
            {
                MathNodeValue mv = context.Instance as MathNodeValue;
                if (mv != null)
                {
                    dlgValue c = new dlgValue();
                    c.SetProperty(new PropertySpec("Value", mv.DataType.Type, "", "choose a value"));
                    c.SetCaller(edSvc);
                    c.ReturnValue = mv.Value;
                    return(c);
                }
                else
                {
                    MathNodeObjRef mo = context.Instance as MathNodeObjRef;
                    if (mo != null)
                    {
                        IObjectRefSelector selector = (IObjectRefSelector)MathNode.GetService(typeof(IObjectRefSelector));
                        if (selector != null)
                        {
                            IDataSelectionControl dlg = selector.GetSelector(mo);
                            dlg.SetCaller(edSvc);
                            return(dlg);
                        }
                    }
                }
            }
            return(null);
        }
        public override object CloneExp(MathNode parent)
        {
            MathNodeObjRef node = (MathNodeObjRef)base.CloneExp(parent);

            if (_value != null)
            {
                node.ObjectReference = (ObjectRef)_value.Clone();
            }
            return(node);
        }
예제 #3
0
        protected override void OnLoaded()
        {
            int n = ChildNodeCount;

            if (n != 2)
            {
                ChildNodeCount = 2;
            }
            if (!(this[0] is MathNodeObjRef))
            {
                MathNodeObjRef v = new MathNodeObjRef(this);
                v.ObjectReference.Type = MathExp.RaisTypes.ObjectRefType.Property;
                this[0] = v;
            }
        }
예제 #4
0
 public override MathNode CreateDefaultNode(int i)
 {
     if (i == 0)
     {
         MathNodeObjRef v = new MathNodeObjRef(this);
         v.ObjectReference.Type = MathExp.RaisTypes.ObjectRefType.Property;
         return(v);
     }
     else if (i == 1)
     {
         MathNodeDefaultValue v = new MathNodeDefaultValue(this);
         return(v);
     }
     return(base.CreateDefaultNode(i));
 }