Microsoft.JScript.Class.CanSee C# (CSharp) Method

CanSee() private method

private CanSee ( MemberInfo member ) : bool
member System.Reflection.MemberInfo
return bool
      private bool CanSee(MemberInfo member){
        switch (member.MemberType){
          case MemberTypes.Method:
            {MethodAttributes visibility = ((MethodBase)member).Attributes & MethodAttributes.MemberAccessMask;
            if (visibility == MethodAttributes.Private || visibility == MethodAttributes.PrivateScope || visibility == MethodAttributes.FamANDAssem)
              return false;
            if (visibility == MethodAttributes.Assembly)
              return IsInTheSamePackage(member);
            return true;}
          case MemberTypes.Field:
            {FieldAttributes visibility = ((FieldInfo)member).Attributes & FieldAttributes.FieldAccessMask;
            if (visibility == FieldAttributes.Private || visibility == FieldAttributes.PrivateScope || visibility == FieldAttributes.FamANDAssem)
              return false;
            if (visibility == FieldAttributes.Assembly)
              return IsInTheSamePackage(member);
            return true;}
          case MemberTypes.Property:
            {MethodBase propMethod = JSProperty.GetGetMethod((PropertyInfo)member, true);
            if (propMethod == null)
              propMethod = JSProperty.GetSetMethod((PropertyInfo)member, true);
            if (propMethod == null)
              return false;
            else{
              MethodAttributes visibility = propMethod.Attributes & MethodAttributes.MemberAccessMask;
              if (visibility == MethodAttributes.Private || visibility == MethodAttributes.PrivateScope || visibility == MethodAttributes.FamANDAssem)
                return false;
              if (visibility == MethodAttributes.Assembly)
                return IsInTheSamePackage(member);
            }
            return true;}
          case MemberTypes.Event:
            {MethodBase addMethod = ((EventInfo)member).GetAddMethod();
            if (addMethod == null)
              return false;
            else{
              MethodAttributes visibility = addMethod.Attributes & MethodAttributes.MemberAccessMask;
              if (visibility == MethodAttributes.Private || visibility == MethodAttributes.PrivateScope || visibility == MethodAttributes.FamANDAssem)
                return false;
              if (visibility == MethodAttributes.Assembly)
                return IsInTheSamePackage(member);
            }
            return true;}
          case MemberTypes.TypeInfo: 
          case MemberTypes.NestedType:
            {TypeAttributes visibility = ((Type)member).Attributes & TypeAttributes.VisibilityMask;
            if (visibility == TypeAttributes.NestedPrivate || visibility == TypeAttributes.NestedFamANDAssem)
              return false;
            if (visibility == TypeAttributes.NestedAssembly)
              return IsInTheSamePackage(member);
            return true;}
        }
        return true;
      }