コード例 #1
0
            public PropertyGetter(VirtualPropertyBase property, Func <object, object> getter, IEnumerable <Attribute> getterAttributes)
                : base(property)
            {
                Debug.Assert(null != getter);

                _getter     = getter;
                _attributes = getterAttributes ?? CollectionServices.Empty <Attribute>();
            }
コード例 #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>();
            }
コード例 #3
0
ファイル: VirtualPropertyBase.cs プロジェクト: zqb971/mef
        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()));
        }
コード例 #4
0
            protected FuncPropertyAccessorBase(VirtualPropertyBase declaringProperty)
            {
                Debug.Assert(null != declaringProperty);

                DeclaringProperty = declaringProperty;
            }
コード例 #5
0
 protected PropertyGetterBase(VirtualPropertyBase property)
     : base(property)
 {
 }
コード例 #6
0
            protected FuncPropertyAccessorBase(VirtualPropertyBase declaringProperty)
            {
                Contract.Requires(null != declaringProperty);

                _declaringProperty = declaringProperty;
            }