Exemplo n.º 1
0
        public static void DefineProperty(
            this TypeBuilder t, String name, Type propertyType, out MethodBuilder get, out MethodBuilder set, out FieldBuilder backing)
        {
            t.DefineProperty(name, propertyType, out get, out set);

            backing = t.DefineField("_" + name.ToLower(), propertyType, FA.Private);
            get.il().ldarg(0).ldfld(backing).ret();
            set.il().ldarg(0).ldarg(1).stfld(backing).ret();
        }