Show / Hide Table of Contents

Class Reflection

Contains a series of functions that complement the reflection capabilities of C#, to conveniently allow for things like iterating over all types that a given type can be casted to.

Inheritance
System.Object
Reflection
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GoRogue
Assembly: GoRogue.dll
Syntax
public static class Reflection

Methods

| Improve this Doc View Source

GetRuntimeTypeTree(Object)

Gets the entire inheritanc/interface tree for the actual run-time type of the object passed in. This will include a type representing the actual run-time type of the object, as well as a type representing each superclass of that runtime type, and each interface that runtime type or one of its superclasses implement.

Declaration
public static IEnumerable<Type> GetRuntimeTypeTree(object obj)
Parameters
Type Name Description
System.Object obj

Object to return type tree for.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Type>

The complete inheritance/interface tree for the runtime-type of the object passed in, including the runtime type itself, and all superclasses of that type, as well as Type objects for each interface that runtime type or its superclasses implement.

| Improve this Doc View Source

GetTypeTree(Type)

Gets the entire inheritance/interface tree for the type specified. This will include the type itself, as well as a Type representing each superclass of the type represented by type, and each interface that type or its superclasses implement.

Declaration
public static IEnumerable<Type> GetTypeTree(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Type>

The complete interface/inheritance for the type represented by type, including type, all superclasses, and all interfaces T or its superclasses implement.

Remarks

This function may be somewhat expensive to compute, so if you plan to use it frequently it is recommended to cache the results.

| Improve this Doc View Source

GetTypeTree<T>()

Gets the entire inheritance/interface tree for type T. This will include a Type that represents type T, as well as a Type representing each superclass of T, and each interface that T or its superclasses implement.

Declaration
public static IEnumerable<Type> GetTypeTree<T>()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Type>

The complete interface/inheritance tree of T, including T, all superclasses, and all interfaces T or its superclasses implement.

Type Parameters
Name Description
T

Type to get inheritance/interface tree for.

Remarks

This function may be somewhat expensive to compute, so if you plan to use it frequently it is recommended to cache the results.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX