Skip to content
master
Go to file
Code

README.md

.NET Standard Polyfills

NuGet Build status Tests status

A set of Type and Reflection polyfill extension methods for .NET Standard v1.0+ and .NET v3.5+.

Type Info:

  • Type.IsAbstract()
  • Type.IsAnonymous()
  • Type.IsClass()
  • Type.IsClosedTypeOf(Type genericTypeDefinition)
  • Type.IsAssignableTo(Type type)
  • Type.IsDerivedFrom(Type parentType)
  • Type.IsEnum()
  • Type.IsInterface()
  • Type.IsGenericType()
  • Type.IsPrimitive()
  • Type.IsPublic()
  • Type.IsSealed()
  • Type.IsValueType()
  • Type.GetAttributes()
  • Type.GetAssembly()
  • Type.GetBaseType()
  • Type.GetInterfaces()
  • Type.GetGenericTypeArguments()
  • Type.GetTypeCode()
  • Type.HasAttribute<TAttribute>()

Constructor Retrieval:

  • Type.GetPublicInstanceConstructors()
  • Type.GetPublicInstanceConstructor(params Type[] parameterTypes)
  • Type.GetNonPublicInstanceConstructors()
  • Type.GetNonPublicInstanceConstructor(params Type[] parameterTypes)

Field Retrieval:

  • Type.GetPublicStaticFields()
  • Type.GetPublicStaticField(string name)
  • Type.GetPublicInstanceFields()
  • Type.GetPublicInstanceField(string name)
  • Type.GetNonPublicStaticFields()
  • Type.GetNonPublicStaticField(string name)
  • Type.GetNonPublicInstanceFields()
  • Type.GetNonPublicInstanceField(string name)

Property Retrieval:

  • Type.GetPublicStaticProperties()
  • Type.GetPublicStaticProperty(string name)
  • Type.GetPublicInstanceProperties()
  • Type.GetPublicInstanceProperty(string name)
  • Type.GetNonPublicStaticProperties()
  • Type.GetNonPublicStaticProperty(string name)
  • Type.GetNonPublicInstanceProperties()
  • Type.GetNonPublicInstanceProperty(string name)

Method Retrieval:

  • Type.GetPublicMethods()
  • Type.GetPublicMethod(string name)
  • Type.GetPublicMethod(string name, int parameterCount)
  • Type.GetPublicMethod(string name, params Type[] parameterTypes)* Type.GetPublicStaticMethods()
  • Type.GetPublicStaticMethod(string name)
  • Type.GetPublicStaticMethod(string name, int parameterCount)
  • Type.GetPublicStaticMethod(string name, params Type[] parameterTypes)
  • Type.GetPublicInstanceMethods()
  • Type.GetPublicInstanceMethod(string name)
  • Type.GetPublicInstanceMethod(string name, int parameterCount)
  • Type.GetPublicInstanceMethod(string name, params Type[] parameterTypes)
  • Type.GetNonPublicStaticMethods()
  • Type.GetNonPublicStaticMethod(string name)
  • Type.GetNonPublicStaticMethod(string name, int parameterCount)
  • Type.GetNonPublicStaticMethod(string name, params Type[] parameterTypes)
  • Type.GetNonPublicInstanceMethods()
  • Type.GetNonPublicInstanceMethod(string name)
  • Type.GetNonPublicInstanceMethod(string name, int parameterCount)
  • Type.GetNonPublicInstanceMethod(string name, params Type[] parameterTypes)

Member Retrieval:

  • Type.GetPublicStaticMembers()
  • Type.GetPublicStaticMembers(string name)
  • Type.GetPublicStaticMember(string name)
  • Type.GetPublicInstanceMembers()
  • Type.GetPublicInstanceMembers(string name)
  • Type.GetPublicInstanceMember(string name)
  • Type.GetNonPublicStaticMembers()
  • Type.GetNonPublicStaticMembers(string name)
  • Type.GetNonPublicStaticMember(string name)
  • Type.GetNonPublicInstanceMembers()
  • Type.GetNonPublicInstanceMembers(string name)
  • Type.GetNonPublicInstanceMember(string name)

Operator Retrieval:

  • Type.GetOperators(Action matcher = null)
  • Type.GetImplicitOperators()
  • Type.GetImplicitOperator(Action matcher = null)
  • Type.GetExplicitOperators()
  • Type.GetExplicitOperator(Action matcher = null)

Assembly Info:

  • Assembly.GetAllTypes()

Misc

  • ParameterInfo.IsParamsArray()
  • PropertyInfo.IsPublic()
  • PropertyInfo.IsStatic()
  • PropertyInfo.IsReadable()
  • PropertyInfo.IsWritable()
  • PropertyInfo.IsIndexer()
  • PropertyInfo.GetAccessors(bool nonPublic)
  • PropertyInfo.GetGetter(bool nonPublic)
  • PropertyInfo.GetSetter(bool nonPublic)
  • MethodInfo.IsImplicitOperator()
  • MethodInfo.IsExplicitOperator()
  • MemberInfo.HasAttribute<TAttribute>()

Download

You can download and install using the NuGet package, or clone the repository on GitHub.

About

Type and Reflection polyfill extension methods for .NET 3.5, .NET 4.0 and .NET Standard 1.0

Topics

Resources

License

Packages

No packages published
You can’t perform that action at this time.