Context

Description

sealed class Tinman.Core.Util.Context

Derived from

IBeginEnd

Helper object for passing frames of context objects along with method chains.

The IBeginEnd.Begin and IBeginEnd.End method can be used to save and restore the current context using an internal stack.

Public / Constructors

Context


public constructor Context → ()

Creates a new instance of Context.

Public / Methods

Clear


public method Clear → (1)

name in : string

[not-empty]
The context object name.

returns → Context

this

Clears a named context object.

Get


[Pure]
public method Get → (1)

name in : string

[not-empty]
The context object name.

returns → object

The context object or null.

Returns a named context object.

Get​Bool


[Pure]
public method GetBool → (2)

name in : string

[not-empty]
The context value name.

defaultValue opt : bool = false

The value to return if there is no context value.

returns → bool

The boolean value.

Returns a named context boolean value.

Get​Int


[Pure]
public method GetInt → (2)

name in : string

[not-empty]
The context value name.

defaultValue opt : int32 = 0

The value to return if there is no context value.

returns → int32

The integer value.

Returns a named context integer value.

Get​String


public method GetString → (2)

name in : string

[not-empty]
The context value name.

defaultValue opt : string = null

The value to return if there is no context value.

returns → string

The boolean value.

Returns a named context string value.

Is


[Pure]
public method Is → (1)

name in : string

[not-empty]
The context flag name.

returns → bool

The context value.

Returns a named context flag.

Set

4 overloads


public method Set1 → (2)

name in : string

[not-empty]
The context object name.

value in : object

The context object.

returns → Context

this

Sets a named context object.


public method Set2 → (2)

name in : string

[not-empty]
The context flag name.

value in : bool

The context flag.

returns → Context

this

Sets a named boolean flag.


public method Set3 → (2)

name in : string

[not-empty]
The context value name.

value in : int32

The context value.

returns → Context

this

Sets a named integer value.


public method Set4 → (2)

name in : string

[not-empty]
The context value name.

value in : string

The context flag value.

returns → Context

this

Sets a named string value.