public override object Clone()
        {
            ParameterDrawing clone = (ParameterDrawing)base.Clone();

            return(clone);
        }
        /// <summary>
        /// create ParameterDrawing and ports
        /// </summary>
        /// <returns></returns>
        public Control[] GetControls()
        {
            List <LinkLineNodeOutPort> _outports = new List <LinkLineNodeOutPort>();

            LinkLineNodeOutPort[] _outportsV = this.Variable.OutPorts;
            List <Control>        cs         = new List <Control>();

            pd           = new ParameterDrawing();
            pd.Parameter = this;
            cs.Add(pd);
            _outports.AddRange(_outportsV);
            //cast type==================================
            if (_castTo != null)
            {
                if (_castTo.Outports != null)
                {
                    _outports.AddRange(_castTo.Outports);
                }
                //new out port
                if (_castTo.NewOutport == null)
                {
                    ProgramNewOutPort op = new ProgramNewOutPort(this);
                    _castTo.NewOutport = op;
                }
                pd.XmlData = _castTo.OwnerObject.GetXmlNode();
                _outports.Add(_castTo.NewOutport);
            }
            //===========================================
            for (int i = 0; i < _outports.Count; i++)
            {
                cs.Add(_outports[i].Label);
                _outports[i].Owner = pd;
                if (_outports[i] is ProgramOutPort)
                {
                }
                else
                {
                    if (_outports[i].Label != null)
                    {
                        ((DrawingVariable)_outports[i].Label).OnMouseSelect += new EventHandler(Parameter_OnMouseSelect);
                        if (((DrawingVariable)_outports[i].Label).Variable != null)
                        {
                            ((DrawingVariable)_outports[i].Label).Variable.VariableName = this.Name;
                            ((MathNodeVariable)(((DrawingVariable)_outports[i].Label).Variable)).VariableType = this.DataType;
                        }
                    }
                }
                if (_outports[i].LinkedInPort == null)
                {
                    LinkLineNode l = _outports[i];
                    while (l != null)
                    {
                        cs.Add(l);
                        l = (LinkLineNode)l.NextNode;
                    }
                }
                else
                {
                    cs.Add(_outports[i]);
                }
            }
            Control[] a = new Control[cs.Count];
            cs.CopyTo(a);
            return(a);
        }