Exemplo n.º 1
0
        public VirtualPropertyInfo(
            string name,
            Type propertyType,
            Func <object, object> getter,
            Action <object, object> setter,
            IEnumerable <Attribute> propertyAttributes,
            IEnumerable <Attribute> getterAttributes,
            IEnumerable <Attribute> setterAttributes,
            CustomReflectionContext context)
            : base(propertyType, name, context)
        {
            if (getter == null && setter == null)
            {
                throw new ArgumentException(SR.ArgumentNull_GetterOrSetterMustBeSpecified);
            }

            CustomType rcType = propertyType as CustomType;

            if (rcType == null || rcType.ReflectionContext != context)
            {
                throw new ArgumentException(SR.Argument_PropertyTypeFromDifferentContext);
            }

            if (getter != null)
            {
                _getter = new PropertyGetter(this, getter, getterAttributes);
            }

            if (setter != null)
            {
                _setter = new PropertySetter(this, setter, setterAttributes);
            }

            _attributes = propertyAttributes ?? CollectionServices.Empty <Attribute>();
        }
            public PropertyGetter(VirtualPropertyBase property, Func <object, object> getter, IEnumerable <Attribute> getterAttributes)
                : base(property)
            {
                Debug.Assert(null != getter);

                _getter     = getter;
                _attributes = getterAttributes ?? CollectionServices.Empty <Attribute>();
            }
Exemplo n.º 3
0
            public PropertySetter(VirtualPropertyBase property, Action <object, object> setter, IEnumerable <Attribute> setterAttributes)
                : base(property)
            {
                Debug.Assert(null != setter);

                _setter         = setter;
                _valueParameter = new VirtualParameter(this, property.PropertyType, "value", 0);
                _attributes     = setterAttributes ?? CollectionServices.Empty <Attribute>();
            }
Exemplo n.º 4
0
 public override IList <CustomAttributeData> GetCustomAttributesData()
 {
     return(CollectionServices.Empty <CustomAttributeData>());
 }
Exemplo n.º 5
0
 public override ParameterInfo[] GetParameters()
 {
     return(CollectionServices.Empty <ParameterInfo>());
 }
Exemplo n.º 6
0
 public override sealed Type[] GetGenericArguments()
 {
     return(CollectionServices.Empty <Type>());
 }
Exemplo n.º 7
0
 public override object[] GetCustomAttributes(bool inherit)
 {
     return(CollectionServices.Empty <object>());
 }
Exemplo n.º 8
0
 public override object[] GetCustomAttributes(Type attributeType, bool inherit)
 {
     return(CollectionServices.Empty <Attribute>());
 }
Exemplo n.º 9
0
 public override sealed Type[] GetRequiredCustomModifiers()
 {
     return(CollectionServices.Empty <Type>());
 }
Exemplo n.º 10
0
 protected override Type[] GetParameterTypes()
 {
     return(CollectionServices.Empty <Type>());
 }