示例#1
0
        private static void WrapProperty(IClass t, IOperand wrapped, PropertyInfo pi)
        {
            var property = t.Property(pi).Public;

            if (pi.CanRead)
            {
                var getter = property.Getter();
                using (var c = getter.Code())
                {
                    c.Return(wrapped.Property(pi, getter.Args.AsOperands()));
                }
            }
            if (pi.CanWrite)
            {
                var setter = property.Setter();
                using (var c = setter.Code())
                {
                    c.Assign(wrapped.Property(pi, setter.Args.AsOperands()), setter.Value);
                }
            }
        }