BogaNet 1.4.0
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
BogaNet.Helper.ObjectHelper Class Referenceabstract

Helper methods for objects. More...

Static Public Member Functions

static ? object GetField (object obj, string name, BindingFlags flags=BindingFlags.NonPublic|BindingFlags.Instance)
 Searches for a field in an object and returns the value.
 
static ? T GetField< T > (object obj, string name, BindingFlags flags=BindingFlags.NonPublic|BindingFlags.Instance)
 Searches for a field in an object and returns the value.
 
static void SetField (object obj, string name, object value, BindingFlags flags=BindingFlags.NonPublic|BindingFlags.Instance)
 Sets the value of a field in an object.
 
static ? object GetProperty (object obj, string name, BindingFlags flags=BindingFlags.NonPublic|BindingFlags.Instance)
 Searches for a property in an object and returns the value.
 
static ? T GetProperty< T > (object obj, string name, BindingFlags flags=BindingFlags.NonPublic|BindingFlags.Instance)
 Searches for a property in an object and returns the value.
 
static void SetProperty (object obj, string name, object value, BindingFlags flags=BindingFlags.NonPublic|BindingFlags.Instance)
 Sets the value of a property in an object.
 
static ? object InvokeMethod (string className, string methodName, BindingFlags flags=BindingFlags.Static|BindingFlags.Public, params object[] parameters)
 Invokes a method on a full qualified class.
 

Detailed Description

Helper methods for objects.

Member Function Documentation

◆ GetField()

static ? object BogaNet.Helper.ObjectHelper.GetField ( object obj,
string name,
BindingFlags flags = BindingFlags::NonPublic | BindingFlags::Instance )
static

Searches for a field in an object and returns the value.

Parameters
objObject-instance
nameName of the field
flagsBinding flags for the field (optional, default: NonPublic/Instance)
Returns
Value of the field
Exceptions
ArgumentNullException

◆ GetField< T >()

static ? T BogaNet.Helper.ObjectHelper.GetField< T > ( object obj,
string name,
BindingFlags flags = BindingFlags::NonPublic | BindingFlags::Instance )
static

Searches for a field in an object and returns the value.

Template Parameters
TType of the field
Parameters
objObject-instance
nameName of the field
flagsBinding flags for the field (optional, default: NonPublic/Instance)
Returns
Value of the field
Exceptions
ArgumentNullException

◆ GetProperty()

static ? object BogaNet.Helper.ObjectHelper.GetProperty ( object obj,
string name,
BindingFlags flags = BindingFlags::NonPublic | BindingFlags::Instance )
static

Searches for a property in an object and returns the value.

Parameters
objObject-instance
nameName of the property
flagsBinding flags for the property (optional, default: NonPublic/Instance)
Returns
Value of the property
Exceptions
ArgumentNullException

◆ GetProperty< T >()

static ? T BogaNet.Helper.ObjectHelper.GetProperty< T > ( object obj,
string name,
BindingFlags flags = BindingFlags::NonPublic | BindingFlags::Instance )
static

Searches for a property in an object and returns the value.

Template Parameters
TType of the property
Parameters
objObject-instance
nameName of the property
flagsBinding flags for the property (optional, default: NonPublic/Instance)
Returns
Value of the property
Exceptions
ArgumentNullException

◆ InvokeMethod()

static ? object BogaNet.Helper.ObjectHelper.InvokeMethod ( string className,
string methodName,
BindingFlags flags = BindingFlags::Static | BindingFlags::Public,
params object[] parameters )
static

Invokes a method on a full qualified class.

Parameters
classNameFull qualified name of the class
methodNamePublic static method of the class to execute
flagsBinding flags for the method (optional, default: static/public)
parametersParameters for the method (optional)
Exceptions
Exception

◆ SetField()

static void BogaNet.Helper.ObjectHelper.SetField ( object obj,
string name,
object value,
BindingFlags flags = BindingFlags::NonPublic | BindingFlags::Instance )
static

Sets the value of a field in an object.

Parameters
objObject-instance
nameName of the field
valueValue as object
flagsBinding flags for the property (optional, default: NonPublic/Instance)
Exceptions
ArgumentNullException

◆ SetProperty()

static void BogaNet.Helper.ObjectHelper.SetProperty ( object obj,
string name,
object value,
BindingFlags flags = BindingFlags::NonPublic | BindingFlags::Instance )
static

Sets the value of a property in an object.

Parameters
objObject-instance
nameName of the property
valueValue as object
flagsBinding flags for the property (optional, default: NonPublic/Instance)
Exceptions
ArgumentNullException

The documentation for this class was generated from the following file: