public override void Emit(IMemberEmitter member, ILGenerator gen) { var ci = exceptionType.GetConstructor(new[] { typeof(String) }); var constRef = new ConstReference(errorMessage); var creationStmt = new NewInstanceExpression(ci, constRef.ToExpression()); creationStmt.Emit(member, gen); gen.Emit(OpCodes.Throw); }
public void Emit(ILGenerator gen) { var ci = exceptionType.GetConstructor(new[] { typeof(string) }); var message = new LiteralStringExpression(errorMessage); var creationStmt = new NewInstanceExpression(ci, message); creationStmt.Emit(gen); gen.Emit(OpCodes.Throw); }
public override void Emit(IMemberEmitter member, ILGenerator gen) { var ci = exceptionType.GetConstructor(new[] { typeof(string) }); var constRef = new ConstReference(errorMessage); var creationStmt = new NewInstanceExpression(ci, constRef.ToExpression()); creationStmt.Emit(member, gen); gen.Emit(OpCodes.Throw); }