C# Class StatePrinting.FieldHarvesters.ToStringAwareHarvester

Harvest all fields, public and private. Or use the ToString() if such is implemented on the class. We ignore the types from the following namespaces System.Reflection System.Runtime System.Func
Inheritance: IFieldHarvester
Mostra file Open project: kbilsted/StatePrinter

Public Methods

Method Description
CanHandleType ( Type type ) : bool
GetFields ( Type type ) : List

We ignore all properties as they, in the end, will only point to some computed state or other fields. Hence they do not provide information about the actual state of the object.

ToStringAwareHarvester ( ) : System

Private Methods

Method Description
GetMethodInfo ( Type type ) : MethodInfo

This more thorough way to avoid the "Ambiguous match found" exception while retrieving the ToString method Explained here http://stackoverflow.com/questions/11443707/getproperty-reflection-results-in-ambiguous-match-found-on-new-property

Method Details

CanHandleType() public method

public CanHandleType ( Type type ) : bool
type System.Type
return bool

GetFields() public method

We ignore all properties as they, in the end, will only point to some computed state or other fields. Hence they do not provide information about the actual state of the object.
public GetFields ( Type type ) : List
type System.Type
return List

ToStringAwareHarvester() public method

public ToStringAwareHarvester ( ) : System
return System