C# Class StatePrinting.FieldHarvesters.HarvestHelper

Reusable helper methods when implementing IFieldHarvester
Show file Open project: kbilsted/StatePrinter Class Usage Examples

Public Methods

Method Description
GetFields ( Type type, BindingFlags flags ) : IEnumerable

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

GetFields ( Type type ) : List

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

GetFieldsAndProperties ( Type type, BindingFlags flags ) : IEnumerable

Returns all Membertype.Field and Membertype.Property except backing-fields

GetFieldsAndProperties ( Type type ) : List
IsHarvestable ( Type type ) : bool

Tell if the type makes any sense to dump

SanitizeFieldName ( string fieldName ) : string

Replaces the name of properties to remove the k__BackingField nonsense from the name.

Private Methods

Method Description
GetSanitizedFieldInfoForFieldOrProperty ( MemberInfo memberInfo ) : SanitizedFieldInfo
IndexerFilter ( MemberInfo x ) : bool
NonBackingFieldFilter ( MemberInfo x ) : bool

Method Details

GetFields() public method

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

GetFields() public method

We ignore all properties as they, in the end, will only point to some computated 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

GetFieldsAndProperties() public method

Returns all Membertype.Field and Membertype.Property except backing-fields
public GetFieldsAndProperties ( Type type, BindingFlags flags ) : IEnumerable
type System.Type
flags BindingFlags
return IEnumerable

GetFieldsAndProperties() public method

public GetFieldsAndProperties ( Type type ) : List
type System.Type
return List

IsHarvestable() public method

Tell if the type makes any sense to dump
public IsHarvestable ( Type type ) : bool
type System.Type
return bool

SanitizeFieldName() public method

Replaces the name of properties to remove the k__BackingField nonsense from the name.
public SanitizeFieldName ( string fieldName ) : string
fieldName string
return string