Sawmill

Class AutoRewriter<T>

An experimental implementation of IRewriter<T> using reflection.

AutoRewriter<T> looks for the subtype's constructor, and gets/sets the T-children in the order that they appear in the constructor.

Inheritance
Implements
Declaration
public class AutoRewriter<T> : Object, IRewriter<T>
Type Parameters
Name Description

T

Constructors

AutoRewriter()

Create a new instance of AutoRewriter<T>

Declaration
protected AutoRewriter()

Properties

Instance

Gets the single global instance of AutoRewriter<T>.

Declaration
public static AutoRewriter<T> Instance { get; }
Property Value
Type Description

AutoRewriter<T>

The single global instance of AutoRewriter<T>.

Methods

CountChildren(T)

CountChildren(T)
Declaration
public int CountChildren(T value)
Parameters
Type Name Description

T

value

Returns
Type Description

Int32

GetChildren(Span<T>, T)

GetChildren(Span<T>, T)
Declaration
public void GetChildren(Span<T> children, T value)
Parameters
Type Name Description

Span<T>

children

T

value

SetChildren(ReadOnlySpan<T>, T)

SetChildren(ReadOnlySpan<T>, T)
Declaration
public T SetChildren(ReadOnlySpan<T> newChildren, T oldValue)
Parameters
Type Name Description

ReadOnlySpan<T>

newChildren

T

oldValue

Returns
Type Description

T

Implements

IRewriter<T>