Online Maps v3
Loading...
Searching...
No Matches
OnlineMapsReflectionHelper Class Reference

Helper class for compatibility of reflection on WSA. More...

Static Public Member Functions

static bool CheckIfAnonymousType (Type type)
 Checks whether the type is anonymous.
 
static TypeAttributes GetAttributes (Type type)
 Gets the attributes associated with the Type.
 
static string GetEnumDescription (Enum value)
 Get OnlineMapsDescription attribute from Enum.
 
static IEnumerable< FieldInfo > GetFields (Type type, BindingFlags bindingAttr=DefaultLookup)
 Searches for the fields defined for the current Type, using the specified binding constraints.
 
static Type[] GetGenericArguments (Type type)
 Returns an array of Type objects that represent the type arguments of a generic type or the type parameters of a generic type definition.
 
static MemberInfo GetMember (Type type, string name)
 Searches for the public members with the specified name.
 
static IEnumerable< MemberInfo > GetMembers (Type type, BindingFlags bindingAttr=DefaultLookup)
 searches for the members defined for the current Type, using the specified binding constraints.
 
static MemberTypes GetMemberType (MemberInfo member)
 Gets a MemberTypes value indicating the type of the member — method, constructor, event, and so on.
 
static MethodInfo GetMethod (Type type, string name)
 Searches for the public method with the specified name.
 
static MethodInfo GetMethod (Type type, string name, Type[] types)
 Searches for the specified public method whose parameters match the specified argument types.
 
static PropertyInfo[] GetProperties (Type type)
 Returns all the public properties of the current Type.
 
static bool IsClass (Type type)
 Gets a value indicating whether the Type is a class; that is, not a value type or interface.
 
static bool IsGenericType (Type type)
 Gets a value indicating whether the current type is a generic type.
 
static bool IsValueType (Type type)
 Gets a value indicating whether the Type is a value type.
 

Detailed Description

Helper class for compatibility of reflection on WSA.

Member Function Documentation

◆ CheckIfAnonymousType()

static bool OnlineMapsReflectionHelper.CheckIfAnonymousType ( Type type)
static

Checks whether the type is anonymous.

Parameters
typeType
Returns
True - type is anonymous, false - otherwise

◆ GetAttributes()

static TypeAttributes OnlineMapsReflectionHelper.GetAttributes ( Type type)
static

Gets the attributes associated with the Type.

Parameters
typeType
Returns
Attributes of type.

◆ GetEnumDescription()

static string OnlineMapsReflectionHelper.GetEnumDescription ( Enum value)
static

Get OnlineMapsDescription attribute from Enum.

Parameters
valueEnum value
Returns
OnlineMapsDescription attribute

◆ GetFields()

static IEnumerable< FieldInfo > OnlineMapsReflectionHelper.GetFields ( Type type,
BindingFlags bindingAttr = DefaultLookup )
static

Searches for the fields defined for the current Type, using the specified binding constraints.

Parameters
typeType
bindingAttrA bitmask comprised of one or more BindingFlags that specify how the search is conducted.
Returns
An array of FieldInfo objects representing all fields defined for the current Type that match the specified binding constraints.

◆ GetGenericArguments()

static Type[] OnlineMapsReflectionHelper.GetGenericArguments ( Type type)
static

Returns an array of Type objects that represent the type arguments of a generic type or the type parameters of a generic type definition.

Parameters
typeType
Returns
An array of Type objects that represent the type arguments of a generic type. Returns an empty array if the current type is not a generic type.

◆ GetMember()

static MemberInfo OnlineMapsReflectionHelper.GetMember ( Type type,
string name )
static

Searches for the public members with the specified name.

Parameters
typeType
nameThe String containing the name of the public members to get.
Returns
An array of MemberInfo objects representing the public members with the specified name, if found; otherwise, an empty array.

◆ GetMembers()

static IEnumerable< MemberInfo > OnlineMapsReflectionHelper.GetMembers ( Type type,
BindingFlags bindingAttr = DefaultLookup )
static

searches for the members defined for the current Type, using the specified binding constraints.

Parameters
typeType
bindingAttrA bitmask comprised of one or more BindingFlags that specify how the search is conducted.
Returns
An array of MemberInfo objects representing all members defined for the current Type that match the specified binding constraints.

◆ GetMemberType()

static MemberTypes OnlineMapsReflectionHelper.GetMemberType ( MemberInfo member)
static

Gets a MemberTypes value indicating the type of the member — method, constructor, event, and so on.

Parameters
memberMemberInfo
Returns
MemberTypes value

◆ GetMethod() [1/2]

static MethodInfo OnlineMapsReflectionHelper.GetMethod ( Type type,
string name )
static

Searches for the public method with the specified name.

Parameters
typeType
nameThe String containing the name of the public method to get.
Returns
A MethodInfo object representing the public method with the specified name, if found; otherwise, null.

◆ GetMethod() [2/2]

static MethodInfo OnlineMapsReflectionHelper.GetMethod ( Type type,
string name,
Type[] types )
static

Searches for the specified public method whose parameters match the specified argument types.

Parameters
typeType
nameThe String containing the name of the public method to get.
typesAn array of Type objects representing the number, order, and type of the parameters for the method to get.
Returns
A MethodInfo object representing the public method whose parameters match the specified argument types, if found; otherwise, null.

◆ GetProperties()

static PropertyInfo[] OnlineMapsReflectionHelper.GetProperties ( Type type)
static

Returns all the public properties of the current Type.

Parameters
typeType
Returns
An array of PropertyInfo objects representing all public properties of the current Type.

◆ IsClass()

static bool OnlineMapsReflectionHelper.IsClass ( Type type)
static

Gets a value indicating whether the Type is a class; that is, not a value type or interface.

Parameters
typeType
Returns
True if the Type is a class; otherwise, false.

◆ IsGenericType()

static bool OnlineMapsReflectionHelper.IsGenericType ( Type type)
static

Gets a value indicating whether the current type is a generic type.

Parameters
typeType
Returns
True if the current type is a generic type; otherwise, false.

◆ IsValueType()

static bool OnlineMapsReflectionHelper.IsValueType ( Type type)
static

Gets a value indicating whether the Type is a value type.

Parameters
typeType
Returns
True if the Type is a value type; otherwise, false.