/// <summary> /// Visits the specified old value. /// </summary> /// <param name="oldValue">The old value.</param> /// <returns></returns> protected virtual IExpression DeepCopy(OldValue oldValue) { oldValue.Expression = Substitute(oldValue.Expression); oldValue.Type = this.Substitute(oldValue.Type); return oldValue; }
/// <summary> /// Visits the specified old value. /// </summary> /// <param name="oldValue">The old value.</param> public override void Visit(IOldValue oldValue) { OldValue mutableOldValue = new OldValue(oldValue); this.resultExpression = this.myCodeCopier.DeepCopy(mutableOldValue); }
/// <summary> /// Rewrites the children of the given old value expression. /// </summary> public virtual void RewriteChildren(OldValue oldValue) { this.RewriteChildren((Expression)oldValue); oldValue.Expression = this.Rewrite(oldValue.Expression); }
/// <summary> /// Visits the specified old value. /// </summary> /// <param name="oldValue">The old value.</param> /// <returns></returns> public virtual IExpression Visit(OldValue oldValue) { oldValue.Expression = Visit(oldValue.Expression); oldValue.Type = this.Visit(oldValue.Type); return oldValue; }
/// <summary> /// Visits the specified old value. /// </summary> /// <param name="oldValue">The old value.</param> public override void Visit(IOldValue oldValue) { OldValue mutableOldValue = oldValue as OldValue; if (alwaysMakeACopy || mutableOldValue == null) mutableOldValue = new OldValue(oldValue); this.resultExpression = this.myCodeMutator.Visit(mutableOldValue); }