/// <summary> /// Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. /// </summary> /// <param name="variable">The <see cref="Variable" /> property of the result.</param> /// <param name="resource">The <see cref="Resource" /> property of the result.</param> /// <param name="body">The <see cref="Body" /> property of the result.</param> /// <returns>This expression if no children changed, or an expression with the updated children.</returns> public UsingCSharpStatement Update(ParameterExpression variable, Expression resource, Expression body) { if (variable == this.Variable && resource == this.Resource && body == this.Body) { return(this); } return(CSharpExpression.Using(variable, resource, body)); }