protected override void OnCloneDataType(MathNode cloned) { if (_dataType != null) { MathNodeCondition m = (MathNodeCondition)cloned; m._dataType = _dataType.Clone() as RaisDataType; } }
protected override void OnLoaded() { int n = ChildNodeCount; if (n < 2) { ChildNodeCount = 2; } if (!(this[n - 1] is IVariable)) { this[n - 1] = new MathNodeVariable(this); ((IVariable)this[n - 1]).IsLocal = true; } ((IVariable)this[n - 1]).IsLocal = true; ((IVariable)this[n - 1]).VariableName = string.Format(CultureInfo.InvariantCulture, "s{0}", Guid.NewGuid().GetHashCode().ToString("x", CultureInfo.InvariantCulture)); for (int i = 0; i < n - 2; i++) { if (!(this[i] is MathNodeCondition)) { this[i] = new MathNodeCondition(this); } } }
public override void OnReplaceNode(MathNode replaced) { if (replaced != null) { _dataType = replaced.DataType; int n = this.ChildNodeCount; for (int i = 0; i < n; i++) { MathNodeCondition mc = this[i] as MathNodeCondition; if (mc != null) { mc[1] = replaced.CloneExp(mc) as MathNode; } else { MathNodeValue v = this[i] as MathNodeValue; if (v != null) { v.ValueType = replaced.DataType.Clone() as RaisDataType; } } } } }