Пример #1
0
 public static bool IsSettingOverwritten(PropertyValue localProperty, PropertyValue parentProperty)
 {
     if ((parentProperty == null) || (localProperty == null))
     {
         return false;
     }
     if (localProperty.PropertyType != parentProperty.PropertyType)
     {
         throw new ArgumentException(Strings.ComparingDifferentPropertyTypes);
     }
     return localProperty.OverridesProperty(parentProperty);
 }
Пример #2
0
        /// <summary>
        /// Determines whether the local property overrides the parent property.
        /// </summary>
        /// <param name="localProperty">The local property.</param>
        /// <param name="parentProperty">The parent property.</param>
        /// <returns>Returns true if the local property overrides the parent property.</returns>
        public static bool IsSettingOverwritten(PropertyValue localProperty, PropertyValue parentProperty)
        {
            Param.Ignore(localProperty, parentProperty);

            // If either the parent property or the local property is not set, then the setting is not overwritten.
            if (parentProperty == null || localProperty == null)
            {
                return false;
            }

            // Ensure that the two properties are the same kind of property.
            if (localProperty.PropertyType != parentProperty.PropertyType)
            {
                throw new ArgumentException(Strings.ComparingDifferentPropertyTypes);
            }

            return localProperty.OverridesProperty(parentProperty);
        }