private static int VisibilityValue(MethodInfo method) { if (method.IsPublic) { return(1); } else if (method.IsFamily) { return(2); } else if (method.IsAssembly) { return(3); } else if (method.IsPrivate) { return(4); } ThrowException.ThrowFormatException("Unable to define the visibility!"); return(-1); // for compilation only }
private static string GetAccessModifier(MethodInfo method) { if (method.IsPublic) { return("public"); } else if (method.IsPrivate) { return("private"); } else if (method.IsAssembly) { return("internal"); } else if (method.IsFamily) { return("protected"); } ThrowException.ThrowFormatException("Unable to define the accessor modifier!"); return(string.Empty); // for compilation only }