Emit() public method

public Emit ( IMemberEmitter member, ILGenerator gen ) : void
member IMemberEmitter
gen System.Reflection.Emit.ILGenerator
return void
		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);
		}
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }