PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.IPropertyOrField Interface Reference

Represents a property or a field on an object. More...

Inheritance diagram for PeanutButter.Utils.IPropertyOrField:
PeanutButter.Utils.PropertyOrField

Public Member Functions

object GetValue (object host)
 Gets the value of the property or field for the provided host.
bool TryGetValue (object host, out object value, out Exception exception)
 Attempts to get the value of the property.
void SetValue (object host, object value)
 Sets the value of the property or field on the provided host.
void SetValue< T > (ref T host, object value)
 Sets the value for the field or property as found on the provided host.
void SetValueAt (object host, object value, object index)
 Sets the value in a collection at that index, if possible.
object GetValueAt (object host, object index)
 Get the value at the provided index into a collection.

Properties

string Name [get]
 Name of the property or field.
Type Type [get]
 Type of the property or field.
bool CanWrite [get]
 Write access to property or field.
bool CanRead [get]
 Read access to property or field.
Type DeclaringType [get]
 The type on which this property or field is declared.
Type HostingType [get]
 The type from which this property or field is read.
int AncestralDistance [get]
 Returns the ancestral distance between the DeclaringType and the HostingType (0 if they are the same type)

Detailed Description

Represents a property or a field on an object.

Member Function Documentation

◆ GetValue()

object PeanutButter.Utils.IPropertyOrField.GetValue ( object host)

Gets the value of the property or field for the provided host.

Parameters
host
Returns

Implemented in PeanutButter.Utils.PropertyOrField.

◆ GetValueAt()

object PeanutButter.Utils.IPropertyOrField.GetValueAt ( object host,
object index )

Get the value at the provided index into a collection.

Parameters
host
index
Returns

Implemented in PeanutButter.Utils.PropertyOrField.

◆ SetValue()

void PeanutButter.Utils.IPropertyOrField.SetValue ( object host,
object value )

Sets the value of the property or field on the provided host.

Parameters
host
value

Implemented in PeanutButter.Utils.PropertyOrField.

◆ SetValue< T >()

void PeanutButter.Utils.IPropertyOrField.SetValue< T > ( ref T host,
object value )

Sets the value for the field or property as found on the provided host.

Parameters
host
value
Template Parameters
T

Implemented in PeanutButter.Utils.PropertyOrField.

◆ SetValueAt()

void PeanutButter.Utils.IPropertyOrField.SetValueAt ( object host,
object value,
object index )

Sets the value in a collection at that index, if possible.

Parameters
host
value
index

Implemented in PeanutButter.Utils.PropertyOrField.

◆ TryGetValue()

bool PeanutButter.Utils.IPropertyOrField.TryGetValue ( object host,
out object value,
out Exception exception )

Attempts to get the value of the property.

  • if the getter throws, returns false and the output exception is set
  • if the getter succeeds, returns true and the output value is set
Parameters
host
value
exception
Returns

Implemented in PeanutButter.Utils.PropertyOrField.

Property Documentation

◆ AncestralDistance

int PeanutButter.Utils.IPropertyOrField.AncestralDistance
get

Returns the ancestral distance between the DeclaringType and the HostingType (0 if they are the same type)

Implemented in PeanutButter.Utils.PropertyOrField.

◆ CanRead

bool PeanutButter.Utils.IPropertyOrField.CanRead
get

Read access to property or field.

Implemented in PeanutButter.Utils.PropertyOrField.

◆ CanWrite

bool PeanutButter.Utils.IPropertyOrField.CanWrite
get

Write access to property or field.

Implemented in PeanutButter.Utils.PropertyOrField.

◆ DeclaringType

Type PeanutButter.Utils.IPropertyOrField.DeclaringType
get

The type on which this property or field is declared.

Implemented in PeanutButter.Utils.PropertyOrField.

◆ HostingType

Type PeanutButter.Utils.IPropertyOrField.HostingType
get

The type from which this property or field is read.

  • this may not be the DeclaringType as the property or field may be inherited
  • this must be explicitly provided by callers

Implemented in PeanutButter.Utils.PropertyOrField.

◆ Name

string PeanutButter.Utils.IPropertyOrField.Name
get

Name of the property or field.

Implemented in PeanutButter.Utils.PropertyOrField.

◆ Type

Type PeanutButter.Utils.IPropertyOrField.Type
get

Type of the property or field.

Implemented in PeanutButter.Utils.PropertyOrField.


The documentation for this interface was generated from the following file:
  • source/Utils/PeanutButter.Utils/PropertyOrField.cs