Emit() public méthode

public Emit ( IMemberEmitter member, ILGenerator gen ) : void
member IMemberEmitter
gen System.Reflection.Emit.ILGenerator
Résultat 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);
		}
Exemple #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);
        }
Exemple #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);
        }