Interface IConfigurationSerializationContext<T>
The context with which the serialization for a IAbstractConfigurationNode occurs. See implementations of IConfigurationTransformer<TOutput> where TOutput is System.String or System.Byte[].
Namespace: Snowflake.Configuration.Serialization
Assembly: Snowflake.Framework.Primitives.dll
Syntax
public interface IConfigurationSerializationContext<T>
Type Parameters
| Name | Description |
|---|---|
| T | The serialized type the context handles. |
Properties
Result
Gets the current resultant state of the serialization. This may be incomplete if serialization is not complete.
Declaration
T Result { get; }
Property Value
| Type | Description |
|---|---|
| T |
ScopeLevel
Gets the current number of nested scopes.
Declaration
int ScopeLevel { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
Append(T)
Appends new content to the context.
Declaration
void Append(T content)
Parameters
| Type | Name | Description |
|---|---|---|
| T | content | The content to append. |
EnterScope(String)
Enters a new scope or block within the serialization. Scoping can be thought of as a stack where entering pushes a new item to the top of the stack.
Declaration
T EnterScope(string scope)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | scope | The name of the scope. |
Returns
| Type | Description |
|---|---|
| T | The name of the scope entered represented in |
ExitScope()
Exits the current block within the serialization. Scoping can be thought of as a stack where exiting pops an item off the stack.
Declaration
T ExitScope()
Returns
| Type | Description |
|---|---|
| T | The name of the scope exited represented in |
GetCurrentScope()
Gets the representation of the current (top-most) scope as T.
Declaration
T GetCurrentScope()
Returns
| Type | Description |
|---|---|
| T | The representation of the top-most scope as For other types of serialization, choose values that make sense. |
GetFullScope()
Gets the full representation of current scope, including all parent scopes, as an chronological array where the earliest entered scope is first.
Declaration
T[] GetFullScope()
Returns
| Type | Description |
|---|---|
| T[] | The full representation of the current scope. If no scopes are entered, then an empty array. |