UmbracoCms.Core by Umbraco HQ

<PackageReference Include="UmbracoCms.Core" Version="8.18.1" />

.NET API 2,660,864 bytes

 TypeHelper

static class TypeHelper
A utility class for type checking, this provides internal caching so that calls to these methods will be faster than doing a manual type check in c#
public static FieldInfo[] CachedDiscoverableFields(Type type)

Gets (and caches) FieldInfo discoverable in the current AppDomain for a given type.

public static PropertyInfo[] CachedDiscoverableProperties(Type type, bool mustRead = true, bool mustWrite = true, bool includeIndexed = false)

Gets (and caches) PropertyInfo discoverable in the current AppDomain for a given type.

public static Attempt<Type> GetLowestBaseType(Type[] types)

Finds a lowest base class amongst a collection of types

public static PropertyInfo GetProperty(Type type, string name, bool mustRead = true, bool mustWrite = true, bool includeIndexed = false, bool caseSensitive = true)

Returns (and caches) a PropertyInfo from a type

public static Assembly[] GetReferencingAssemblies(Assembly assembly, IEnumerable<Assembly> assemblies)

Find all assembly references that are referencing the assignTypeFrom Type's assembly found in the assemblyList

public static bool HasReference(Assembly assembly, string name)

Determines if an assembly references another assembly.

public static bool IsImplicitValueType(Type implementation)

A method to determine whether implementation is an implied value type ( IsValueType, IsEnum or a string).

public static bool IsNonStaticClass(Type t)

Returns true if the type is a class and is not static

public static bool IsOverride(MethodInfo m)

Checks if the method is actually overriding a base method

public static bool IsStaticClass(Type type)

Returns true if the type is a static class

public static bool IsTypeAssignableFrom(Type contract, Type implementation)

Determines whether the type implementation is assignable from the specified implementation, and caches the result across the application using a ConcurrentDictionary<T, U>.

public static bool IsTypeAssignableFrom<TContract>(Type implementation)

Determines whether the type implementation is assignable from the specified implementation TContract, and caches the result across the application using a ConcurrentDictionary<T, U>.

public static bool IsTypeAssignableFrom<TContract>(object implementation)

Determines whether the object instance implementation is assignable from the specified implementation TContract, and caches the result across the application using a ConcurrentDictionary<T, U>.

public static bool IsValueType(Type implementation)

A method to determine whether implementation represents a value type.

public static bool MatchType(Type implementation, Type contract)