protected override void OnCloneDataType(MathNode cloned) { if (_dataType != null) { MathNodeNumber m = (MathNodeNumber)cloned; m._dataType = _dataType.Clone() as RaisDataType; } }
public override object CloneExp(MathNode parent) { MathNodeNumber node = (MathNodeNumber)base.CloneExp(parent); node.Value = _value; node.IsPlaceHolder = IsPlaceHolder; return(node); }
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); }
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); }
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); }