Show / Hide Table of Contents

Method GetPrivateField

| Edit this page View Source

GetPrivateField<T>(object, string)

Get the value of a private field of any class instance
Declaration
public static T GetPrivateField<T>(object instance, string name)
Parameters
Type Name Description
object instance Instance of the class
string name Name of the field
Returns
Type Description
T The value of the field
Type Parameters
Name Description
T Generic field type
| Edit this page View Source

GetPrivateField<T>(Type, string)

Get the value of a private static field of any class
Declaration
public static T GetPrivateField<T>(Type type, string name)
Parameters
Type Name Description
Type type Type of the class
string name Name of the field
Returns
Type Description
T The value of the field
Type Parameters
Name Description
T Generic field type
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾