예제 #1
0
        public FieldDecorator(Type forType, FieldInfo field, IProtoSerializerWithWireType tail)
            : base(tail)
        {
            Helpers.DebugAssert(forType != null);
            Helpers.DebugAssert(field != null);
            this._forType = forType;
            this._field   = field;
            _tail         = tail;
#if FEAT_COMPILER && !FEAT_IKVM
            _accessors = AccessorsCache.GetAccessors(field);
#endif
        }
예제 #2
0
        public PropertyDecorator(TypeModel model, Type forType, PropertyInfo property, IProtoSerializerWithWireType tail)
            : base(tail)
        {
            Helpers.DebugAssert(forType != null);
            Helpers.DebugAssert(property != null);
            this._forType  = forType;
            this._property = property;
            _tail          = tail;
            SanityCheck(model, property, tail, out _canSetInRuntime, true, true, false);
            _shadowSetter = Helpers.GetShadowSetter(model, property);
#if FEAT_COMPILER && !FEAT_IKVM
            _accessors = AccessorsCache.GetAccessors(property);
            if (_shadowSetter != null)
            {
                _accessors.Set = AccessorsCache.GetShadowSetter(_shadowSetter);
            }
#endif
        }