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.

See also

Context.Set1

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.

See also

Context.Set2

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.

See also

Context.Set3

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.

See also

Context.Set4

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.

See also

Context.Get


public method Set2 → (2)

name in : string

[not-empty]
The context value name.

value in : bool

The context value.

returns → Context

this

Sets a named boolean value.

See also

Context.GetBool


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.

See also

Context.GetInt


public method Set4 → (2)

name in : string

[not-empty]
The context value name.

value in : string

The context value.

returns → Context

this

Sets a named string value.