void ReadOnlyPropertySetterShouldNotBePublic(FieldInfo fieldInfo, DPAccessModifierAttribute accessModifier)
 {
     if (accessModifier.SetterVisibility == MemberVisibility.Public)
     {
         AddError(GetFieldInfoDescription(fieldInfo) + "ReadOnlyPropertySetterShouldNotBePublic");
     }
 }
        void CheckDependencyPropertyConsistencyForField(FieldInfo fieldInfo, DPAccessModifierAttribute accessModifier)
        {
            DependencyPropertyFieldInfoShouldBeReadonly(fieldInfo);
            SetterVisibilityShouldBeStrongerThenOrEqualsToGetterVisibility(fieldInfo, accessModifier);
            DependencyPropertyFieldVisibilityShouldBeEqualsToGetterVisibility(fieldInfo, accessModifier);
            DependencyProperty property = DependencyPropertyShouldBeRegistered(fieldInfo);

            if (property == null)
            {
                return;
            }
            DependencyPropertyFieldInfoNameShouldMatchPropertyName(fieldInfo, property);
            CheckDependencyPropertyOwner(fieldInfo, property);
            CheckReadOnlyProperty(fieldInfo, property, accessModifier);
        }
        void CheckReadOnlyProperty(FieldInfo fieldInfo, DependencyProperty property, DPAccessModifierAttribute accessModifier)
        {
            if (!property.ReadOnly)
            {
                return;
            }
            FieldInfo keyFieldInfo = fieldInfo.ReflectedType.GetField(fieldInfo.Name + "Key", BindingFlags.Static | BindingFlags.NonPublic);

            if (keyFieldInfo == null)
            {
                ReadonlyDependencyPropertyOwnerShouldHaveDependencyPropertyKey(fieldInfo);
            }
            else
            {
                DependencyPropertyKeyFieldInfoShouldBeReadonly(fieldInfo);
                if (accessModifier != null)
                {
                    DependencyPropertyKeyFieldInfoShouldBePrivate(keyFieldInfo);
                    ReadOnlyPropertySetterShouldNotBePublic(fieldInfo, accessModifier);
                }
            }
        }
 void DependencyPropertyFieldVisibilityShouldBeEqualsToGetterVisibility(FieldInfo fieldInfo, DPAccessModifierAttribute accessModifier)
 {
     if (GetFieldVisibility(fieldInfo) != accessModifier.GetterVisibility)
     {
         AddError(GetFieldInfoDescription(fieldInfo) + "DependencyPropertyFieldVisibilityShouldBeEqualsToGetterVisibility");
     }
 }
 void SetterVisibilityShouldBeStrongerThenOrEqualsToGetterVisibility(FieldInfo fieldInfo, DPAccessModifierAttribute accessModifier)
 {
     if (accessModifier.GetterVisibility.IsStrongerThen(accessModifier.SetterVisibility))
     {
         AddError(GetFieldInfoDescription(fieldInfo) + "SetterVisibilityShouldBeStrongerThenOrEqualsToGetterVisibility");
     }
 }