MethodInfo and Type objects have a number of properties that can be used to request visibility.
For example, for a type, you can check IsPublic , IsPrivate , IsNotPublic , IsNested , IsNestedFamOrAssembly and much more.
For the method ( MethodInfo object) you have a similar set: IsPublic , IsPrivate , IsFamilyOrAssembly , etc.
So, combine this with information similar to the Assembly property for the type (so that you can determine if types 1 and 2 are in the same assembly) and you can get all the necessary information.
source share