C# Класс Stubble.Core.Context

Represents the context for a template
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
GetValueFromRegistry object
TryEnumerationConversionIfRequired object

Открытые методы

Метод Описание
Context ( object view, Registry registry, Context parentContext, RenderSettings settings ) : System.Reflection

Initializes a new instance of the Context class.

Context ( object view, Registry registry, RenderSettings settings ) : System.Reflection

Initializes a new instance of the Context class.

IsTruthyValue ( object value ) : bool

Checks if the passed value is Truthy

Lookup ( string name ) : object

Looks up a value by name from the context

Push ( object newView ) : Context

Returns a new Context with the given view and it's parent set as the current context

Приватные методы

Метод Описание
GetValueFromRegistry ( object value, string key ) : object

Gets a value from the registry using the initalized value getters

TryEnumerationConversionIfRequired ( object value ) : object

Tries to convert an object into an Enumeration if possible

Описание методов

Context() публичный Метод

Initializes a new instance of the Context class.
public Context ( object view, Registry registry, Context parentContext, RenderSettings settings ) : System.Reflection
view object The data view to create the context with
registry Stubble.Core.Classes.Registry A reference to the a registry instance
parentContext Context The parent context for the new context
settings Stubble.Core.Classes.RenderSettings The render settings
Результат System.Reflection

Context() публичный Метод

Initializes a new instance of the Context class.
public Context ( object view, Registry registry, RenderSettings settings ) : System.Reflection
view object The data view to create the context with
registry Stubble.Core.Classes.Registry A reference to the a registry instance
settings Stubble.Core.Classes.RenderSettings The render settings
Результат System.Reflection

IsTruthyValue() публичный Метод

Checks if the passed value is Truthy
public IsTruthyValue ( object value ) : bool
value object The value to check
Результат bool

Lookup() публичный Метод

Looks up a value by name from the context
If ThrowOnDataMiss set then thrown on value not found
public Lookup ( string name ) : object
name string The name of the value to lookup
Результат object

Push() публичный Метод

Returns a new Context with the given view and it's parent set as the current context
public Push ( object newView ) : Context
newView object The data view to create the new context with
Результат Context