コード例 #1
0
 protected override void OnCloneDataType(MathNode cloned)
 {
     if (_dataType != null)
     {
         MathNodeNumber m = (MathNodeNumber)cloned;
         m._dataType = _dataType.Clone() as RaisDataType;
     }
 }
コード例 #2
0
        public override object CloneExp(MathNode parent)
        {
            MathNodeNumber node = (MathNodeNumber)base.CloneExp(parent);

            node.Value         = _value;
            node.IsPlaceHolder = IsPlaceHolder;
            return(node);
        }
コード例 #3
0
 public string CreateJavaScriptCode(StringCollection method)
 {
     if (_hasData && _exp != null)
     {
         MathNodeNumber mn = _exp[1] as MathNodeNumber;
         if (mn == null || !mn.IsPlaceHolder)
         {
             return(_exp.CreateJavaScript(method));
         }
     }
     return(null);
 }
コード例 #4
0
 public CodeExpression ExportCode(IMethodCompile method)
 {
     if (_hasData && _exp != null)
     {
         MathNodeNumber mn = _exp[1] as MathNodeNumber;
         if (mn == null || !mn.IsPlaceHolder)
         {
             return(_exp.ExportCode(method));
         }
     }
     return(null);
 }
コード例 #5
0
 public override bool Update(string newValue)
 {
     if (!string.IsNullOrEmpty(newValue))
     {
         bool bIsNumber = false;
         char c         = newValue[0];
         if (c == '.' || c == '-')
         {
             bIsNumber = true;
         }
         else
         {
             UnicodeCategory uc = Char.GetUnicodeCategory(c);
             bIsNumber = (uc == UnicodeCategory.DecimalDigitNumber);
         }
         if (bIsNumber)
         {
             MathNodeNumber node = new MathNodeNumber(this.Parent);
             try
             {
                 node.Value = double.Parse(newValue);
                 return(this.ReplaceMe(node));
             }
             catch
             {
             }
         }
         else
         {
             if (nameValid(newValue))
             {
                 _value = newValue;
             }
             else
             {
                 return(false);
             }
         }
     }
     return(true);
 }