protected void ThrowCompileException(string messageKey, CompileExceptionReason reason, params object[] arguments) { string messageTemplate = FleeResourceManager.Instance.GetCompileErrorString(messageKey); string message = string.Format(messageTemplate, arguments); throw new ExpressionCompileException(message, reason); }
protected void ThrowCompileException(string messageKey, CompileExceptionReason reason, params object[] arguments) { var messageTemplate = FleeResourceManager.Instance.GetCompileErrorString(messageKey); var message = string.Format(messageTemplate, arguments); message = string.Concat(this.Name, ": ", message); throw new ExpressionCompileException(message, reason); }
protected void AssertCompileException(string expression, ExpressionContext context, CompileExceptionReason expectedReason = (CompileExceptionReason)(-1)) { try { this.CreateDynamicExpression(expression, context); Assert.Fail("Compile exception expected"); } catch (ExpressionCompileException expressionCompileException) { var ex = expressionCompileException; var flag = expectedReason != (CompileExceptionReason)(-1); if (flag) { Assert.AreEqual((int)expectedReason, (int)ex.Reason, string.Format("Expected reason '{0}' but got '{1}'", expectedReason, ex.Reason)); } } }
private ExpressionCompileException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { _myReason = (CompileExceptionReason)info.GetInt32("Reason"); }
internal ExpressionCompileException(ParserLogException parseException) : base(string.Empty, parseException) { _myReason = CompileExceptionReason.SyntaxError; }
internal ExpressionCompileException(string message, CompileExceptionReason reason) : base(message) { _myReason = reason; }
internal ExpressionCompileException(string message, CompileExceptionReason reason, object[] arguments) : base(message) { Arguments = arguments; _myReason = reason; }
private ExpressionCompileException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { MyReason = (CompileExceptionReason)info.GetInt32("Reason"); }
internal ExpressionCompileException(PerCederberg.Grammatica.Runtime.ParserLogException parseException) : base(string.Empty, parseException) { MyReason = CompileExceptionReason.SyntaxError; }
internal ExpressionCompileException(string message, CompileExceptionReason reason) : base(message) { MyReason = reason; }
protected ExpressionCompileException CreateCompileException(string messageTemplate, CompileExceptionReason reason, params object[] arguments) { var message = string.Format(CultureInfo.InvariantCulture, messageTemplate, arguments); message = string.Concat(Name, ": ", message); return(new ExpressionCompileException(message, reason)); }