protected override void ResolveInternal() { // Try to bind to a field or property if (this.ResolveFieldProperty(MyPrevious) == true) { this.AddReferencedVariable(MyPrevious); return; } // Try to find a variable with our name MyVariableType = MyContext.Variables.GetVariableTypeInternal(MyName); // Variables are only usable as the first element if (MyPrevious == null && (MyVariableType != null)) { this.AddReferencedVariable(MyPrevious); return; } CalculationEngine ce = MyContext.CalculationEngine; if ((ce != null)) { ce.AddDependency(MyName, MyContext); MyCalcEngineReferenceType = ce.ResolveTailType(MyName); return; } if (MyPrevious == null) { base.ThrowCompileException(CompileErrorResourceKeys.NoIdentifierWithName, CompileExceptionReason.UndefinedName, MyName); } else { base.ThrowCompileException(CompileErrorResourceKeys.NoIdentifierWithNameOnType, CompileExceptionReason.UndefinedName, MyName, MyPrevious.TargetType.Name); } }
internal void SetCalcEngine(CalculationEngine engine, string calcEngineExpressionName) { MyProperties.SetValue("CalculationEngine", engine); MyProperties.SetValue("CalcEngineExpressionName", calcEngineExpressionName); }