Skip to content

Instantly share code, notes, and snippets.

@0V

0V/GetRuntimeProperties.cs Secret

Created Dec 31, 2018
Embed
What would you like to do?
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