Class Decorator
Provides a way to dynamically enclose/wrap an object to support the decorator pattern.
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class Decorator
Methods
| Improve this Doc View SourceEnclose<T>(T, Boolean)
Encloses the specified inner
so that it can be extended without violating SRP.
Declaration
public static Decorator<T> Enclose<T>(T inner, bool throwIfNull = true)
Parameters
Type | Name | Description |
---|---|---|
T | inner | The type to decorate. |
Boolean | throwIfNull |
|
Returns
Type | Description |
---|---|
Decorator<T> | An instance of Decorator<T>. |
Type Parameters
Name | Description |
---|---|
T | The type of the |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Syntactic<T>()
Syntactic sugar for the rare cases where retrieving properties exposed as methods is a necessity.
Declaration
public static Decorator<T> Syntactic<T>()
Returns
Type | Description |
---|---|
Decorator<T> | An instance of Decorator<T> where the Inner defaults to |
Type Parameters
Name | Description |
---|---|
T | The type to decorate. |