Skip to content

Instantly share code, notes, and snippets.

@0V
Created December 31, 2018 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0V/07dd8b84b90634e258b0e857fb162266 to your computer and use it in GitHub Desktop.
Save 0V/07dd8b84b90634e258b0e857fb162266 to your computer and use it in GitHub Desktop.
GetRuntimeProperties の中身
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