コード例 #1
0
        protected bool MatchReadOnlyProperty(MemberInfo subject)
        {
            var property = subject as PropertyInfo;

            if (property == null)
            {
                return(false);
            }
            if (CanReadCantWriteInsideType(property) || CanReadCantWriteInBaseType(property))
            {
                return(PropertyToField.GetBackFieldInfo(property) == null);
            }
            return(false);
        }
コード例 #2
0
        protected bool MatchNoSetterProperty(MemberInfo subject)
        {
            var property = subject as PropertyInfo;

            if (property == null || property.CanWrite || !property.CanRead)
            {
                return(false);
            }
            var fieldInfo = PropertyToField.GetBackFieldInfo(property);

            if (fieldInfo != null)
            {
                return(fieldInfo.FieldType == property.PropertyType);
            }

            return(false);
        }
コード例 #3
0
        protected bool MatchPropertyToField(MemberInfo subject)
        {
            var property = subject as PropertyInfo;

            if (property == null)
            {
                return(false);
            }
            var fieldInfo = PropertyToField.GetBackFieldInfo(property);

            if (fieldInfo != null)
            {
                return(fieldInfo.FieldType != property.PropertyType);
            }

            return(false);
        }