コード例 #1
0
        public void MinusMinus()
        {
            Utilities.Reflection.Emit.Assembly    Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
            Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
            IMethodBuilder Method = TestType.CreateConstructor();

            Utilities.Reflection.Emit.PropertyBuilder TestProperty = (Utilities.Reflection.Emit.PropertyBuilder)TestType.CreateProperty("TestProperty", typeof(int));
            Assert.DoesNotThrow(() => -- TestProperty);
        }
コード例 #2
0
ファイル: PropertyBuilder.cs プロジェクト: ewin66/VilinCode
        public void PlusPlus()
        {
            Utilities.Reflection.Emit.Assembly    Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
            Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
            IMethodBuilder Method = TestType.CreateConstructor();

            Utilities.Reflection.Emit.PropertyBuilder TestProperty = (Utilities.Reflection.Emit.PropertyBuilder)TestType.CreateProperty("TestProperty", typeof(int));
            ++TestProperty;
        }
コード例 #3
0
        public void Save()
        {
            Utilities.Reflection.Emit.Assembly    Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
            Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType");
            IMethodBuilder Method = TestType.CreateConstructor();

            Utilities.Reflection.Emit.PropertyBuilder TestProperty = (Utilities.Reflection.Emit.PropertyBuilder)TestType.CreateProperty("TestProperty", typeof(int));
            Assert.Throws <NullReferenceException>(() => TestProperty.Save(null));
            Assert.DoesNotThrow(() => TestProperty.Save(Method.Generator));
        }