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.
Implements
IRewriter<T>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sawmill
Assembly: Sawmill.dll
Syntax
public sealed class AutoRewriter<T> : IRewriter<T>
Type Parameters
Name | Description |
---|---|
T |
Properties
| Improve this Doc View SourceInstance
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
| Improve this Doc View SourceGetChildren(T)
Declaration
public Children<T> GetChildren(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value |
Returns
Type | Description |
---|---|
Children<T> |
RewriteChildren(Func<T, T>, T)
Declaration
public T RewriteChildren(Func<T, T> transformer, T oldValue)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, T> | transformer | |
T | oldValue |
Returns
Type | Description |
---|---|
T |
SetChildren(Children<T>, T)
Declaration
public T SetChildren(Children<T> newChildren, T oldValue)
Parameters
Type | Name | Description |
---|---|---|
Children<T> | newChildren | |
T | oldValue |
Returns
Type | Description |
---|---|
T |