Show / Hide Table of Contents

Class Decorator

Provides a way to dynamically enclose/wrap an object to support the decorator pattern.

Inheritance
Object
Decorator
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class Decorator

Methods

| Improve this Doc View Source

Enclose<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

true to throw an ArgumentNullException when inner is null; false to allow inner to be null. Default is true.

Returns
Type Description
Decorator<T>

An instance of Decorator<T>.

Type Parameters
Name Description
T

The type of the inner to decorate.

Exceptions
Type Condition
ArgumentNullException

inner cannot be null.

| Improve this Doc View Source

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 T.

Type Parameters
Name Description
T

The type to decorate.

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright 2008-2022 Geekle. All rights reserved. Code with passion and love; deploy with confidence. 👨‍💻️🔥❤️🚀😎
Generated by DocFX