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

                _getter     = getter;
                _attributes = getterAttributes ?? CollectionServices.Empty <Attribute>();
            }
Example #2
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>();
            }
Example #3
0
        public override bool Equals(object obj)
        {
            VirtualPropertyBase other = obj as VirtualPropertyBase;

            if (other == null)
            {
                return(false);
            }

            // We don't need to compare the getters and setters.
            // But do we need to compare the contexts and return types?
            return
                (_name == other._name &&
                 _declaringType.Equals(other._declaringType) &&
                 _propertyType == other._propertyType &&
                 CollectionServices.CompareArrays(GetIndexParametersNoCopy(), other.GetIndexParametersNoCopy()));
        }
Example #4
0
            protected FuncPropertyAccessorBase(VirtualPropertyBase declaringProperty)
            {
                Debug.Assert(null != declaringProperty);

                DeclaringProperty = declaringProperty;
            }
Example #5
0
 protected PropertyGetterBase(VirtualPropertyBase property)
     : base(property)
 {
 }
            protected FuncPropertyAccessorBase(VirtualPropertyBase declaringProperty)
            {
                Contract.Requires(null != declaringProperty);

                _declaringProperty = declaringProperty;
            }