public override void OnReferenceExpression(ReferenceExpression node) { base.OnReferenceExpression(node); EvaluationContextEntity entity = node.get_Entity() as EvaluationContextEntity; if (entity != null) { if (!this.ValidateContext(entity)) { IMember member = entity.Delegate; this.get_Errors().Add(CompilerErrorFactory.InstanceRequired(node, member)); } node.get_ParentNode().Replace(node, this.MapToContextReference(entity)); } }
public override void OnReferenceExpression(ReferenceExpression node) { IInternalEntity entity = node.get_Entity() as IInternalEntity; if (entity != null) { InternalField evaluationContextField = this.GetEvaluationContextField(entity.get_Node()); if (evaluationContextField != null) { node.get_ParentNode().Replace(node, this.CreateEvaluationContextFieldReference(evaluationContextField)); } } }