- case AccessLevel.Internal:
- if (al == AccessLevel.Private || al == AccessLevel.Internal)
- same_access_restrictions = TypeManager.IsThisOrFriendAssembly (p.Assembly);
-
- break;
-
- case AccessLevel.Protected:
- if (al == AccessLevel.Protected) {
- same_access_restrictions = mc.Parent.IsBaseType (p_parent);
- break;
- }
-
- if (al == AccessLevel.Private) {
- //
- // When type is private and any of its parents derives from
- // protected type then the type is accessible
- //
- while (mc.Parent != null) {
- if (mc.Parent.IsBaseType (p_parent))
- same_access_restrictions = true;
- mc = mc.Parent;
- }
- }
-
- break;
-
- case AccessLevel.ProtectedOrInternal:
- if (al == AccessLevel.Protected)
- same_access_restrictions = mc.Parent.IsBaseType (p_parent);
- else if (al == AccessLevel.Internal)
- same_access_restrictions = TypeManager.IsThisOrFriendAssembly (p.Assembly);
- else if (al == AccessLevel.ProtectedOrInternal)
- same_access_restrictions = mc.Parent.IsBaseType (p_parent) &&
- TypeManager.IsThisOrFriendAssembly (p.Assembly);
-
+ case AccessLevel.Internal:
+ if (al == AccessLevel.Private || al == AccessLevel.Internal)
+ same_access_restrictions = TypeManager.IsThisOrFriendAssembly (p.Assembly);
+
+ break;
+
+ case AccessLevel.Protected:
+ if (al == AccessLevel.Protected) {
+ same_access_restrictions = mc.Parent.IsBaseType (p_parent);