Beispiel #1
0
        public void TryCatch()
        {
            Utilities.Reflection.Emit.Assembly    Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
            Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
            IMethodBuilder Method = TestType.CreateMethod("TestMethod");
            VariableBase   Local1 = Method.CreateLocal("Local1", typeof(int));
            VariableBase   Local2 = Method.CreateLocal("Local2", typeof(int));

            Utilities.Reflection.Emit.Commands.Try   Try   = Method.Try();
            Utilities.Reflection.Emit.Commands.Catch Catch = Method.Catch(typeof(Exception));
            Method.EndTry();
            Assert.NotNull(Try);
            Assert.NotNull(Catch);
        }