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

                _getter     = getter;
                _attributes = getterAttributes ?? CollectionServices.Empty <Attribute>();
            }
Ejemplo n.º 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>();
            }
Ejemplo n.º 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()));
        }
Ejemplo n.º 4
0
            protected FuncPropertyAccessorBase(VirtualPropertyBase declaringProperty)
            {
                Debug.Assert(null != declaringProperty);

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

                _declaringProperty = declaringProperty;
            }