-
-
Save 0V/07dd8b84b90634e258b0e857fb162266 to your computer and use it in GitHub Desktop.
GetRuntimeProperties の中身
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private const BindingFlags everything = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static; | |
private static void CheckAndThrow(Type t) | |
{ | |
if (t == null) throw new ArgumentNullException("type"); | |
if (!(t is RuntimeType)) throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType")); | |
} | |
public static IEnumerable<PropertyInfo> GetRuntimeProperties(this Type type) | |
{ | |
CheckAndThrow(type); | |
return type.GetProperties(everything); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment