private static PropertyInfo?GetBasePropertyDefinition(RuntimePropertyInfo property) { MethodInfo?method = property.GetGetMethod(true); if (method == null || !method.IsVirtual) { method = property.GetSetMethod(true); } if (method == null || !method.IsVirtual) { return(null); } MethodInfo baseMethod = ((RuntimeMethodInfo)method).GetBaseMethod(); if (baseMethod != null && baseMethod != method) { ParameterInfo[] parameters = property.GetIndexParameters(); if (parameters != null && parameters.Length > 0) { Type[] paramTypes = new Type[parameters.Length]; for (int i = 0; i < paramTypes.Length; i++) { paramTypes[i] = parameters[i].ParameterType; } return(baseMethod.DeclaringType !.GetProperty(property.Name, property.PropertyType, paramTypes)); } else { return(baseMethod.DeclaringType !.GetProperty(property.Name, property.PropertyType)); } } return(null); }
// BEGIN helper methods for Dev11 466969 quirk internal bool HasMatchingAccessibility(RuntimePropertyInfo target) { Contract.Assert(CompatibilitySwitches.IsAppEarlierThanWindowsPhone8); bool match = true; if (!IsMatchingAccessibility(this.GetGetMethod(true), target.GetGetMethod(true))) { match = false; } else if (!IsMatchingAccessibility(this.GetSetMethod(true), target.GetSetMethod(true))) { match = false; } return(match); }
// BEGIN helper methods for Dev11 466969 quirk internal bool HasMatchingAccessibility(RuntimePropertyInfo target) { Contract.Assert(CompatibilitySwitches.IsAppEarlierThanWindowsPhone8); bool match = true; if (!IsMatchingAccessibility(this.GetGetMethod(true), target.GetGetMethod(true))) { match = false; } else if (!IsMatchingAccessibility(this.GetSetMethod(true), target.GetSetMethod(true))) { match = false; } return match; }