internal static bool IsProtectedVisibleTo(MethodInfo method, System.Type derivedType, XamlSchemaContext schemaContext) { if (derivedType == null) { return false; } if (!derivedType.Equals(method.DeclaringType) && !derivedType.IsSubclassOf(method.DeclaringType)) { return false; } if (method.IsFamily || method.IsFamilyOrAssembly) { return true; } if (!method.IsFamilyAndAssembly) { return false; } return (TypeReflector.IsInternal(method.DeclaringType) || schemaContext.AreInternalsVisibleTo(method.DeclaringType.Assembly, derivedType.Assembly)); }
internal static bool IsInternalVisibleTo(MethodInfo method, Assembly accessingAssembly, XamlSchemaContext schemaContext) { if (accessingAssembly == null) { return false; } if (!method.IsAssembly && !method.IsFamilyOrAssembly) { return false; } return (TypeReflector.IsInternal(method.DeclaringType) || schemaContext.AreInternalsVisibleTo(method.DeclaringType.Assembly, accessingAssembly)); }