C# Класс Sharpen.Html.Application

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
AutoInit bool
Current Application

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

Метод Описание
CompileTemplate ( string type, string content, object>.Dictionary options ) : Template

Compiles a template instance from the specified template type and content.

DeactivateFragment ( Element element, bool contentOnly ) : void

Deactivates the specified element and its children by disposing any behaviors or binding instances attached to the elements.

GetObject ( Type objectType ) : object

Gets an instance of the specified object type. An instance is created if one has not been registered with the container. A factory method is called if a factory has been registered or implemented on the object type.

GetSetting ( string name ) : string

Gets the value of the specified setting.

GetTemplate ( string name ) : Template

Gets a template instance from the specified template name. The specified name is used to lookup a script element with a matching id.

PublishEvent ( EventArgs eventArgs ) : void

Raises the specified event. The type of the event arguments is used to determine which subscribers the event is routed to.

RegisterBehavior ( string name, Type behaviorType, Type serviceType ) : void

Registers a behavior so it can be used declaratively in markup.

RegisterBinder ( string name, BinderFactory factory ) : void

Registers a binder factory. The supplied name prefixed with "data-" is used as the attribute name in markup to create a binder.

RegisterExpression ( string name, ExpressionFactory factory ) : void

Registers an expression factory. The supplied name is used in markup to represent an instance of the associated expression.

RegisterFactory ( Type objectType, Func objectFactory ) : void

Registers an object factory with the container. The factory is called when the particular object type is requested. The factory can decide whether to cache object instances it returns or not, based on its policy.

RegisterObject ( Type objectType, object objectInstance ) : void

Registers an object instance for the specified object type.

RegisterService ( string name, Type serviceImplementationType, Type serviceType ) : void

Registers a service type.

RegisterTemplate ( string name, Template template ) : void

Registers a template with the specified name.

RegisterTemplateEngine ( string name, TemplateEngine engine ) : void

Registers a template engine. The supplied name is used to match against the mime type attribute on a template script element.

SubscribeEvent ( Type eventType, Callback eventHandler ) : object

Subscribes to the specified type of events. The resulting cookie can be used for unsubscribing.

UnsubscribeEvent ( object subscriptionCookie ) : void

Unsubcribes from a previously subscribed-to event type.

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

Метод Описание
ActivateFragment ( Element element, bool contentOnly ) : void
ActivateFragment ( Element element, bool contentOnly, object model ) : void
Application ( ) : System
AttachBehaviors ( Element element ) : void

Creates and attaches behaviors specified on the element declaratively.

BindContent ( Element element, string property, Expression expression ) : Binder
BindValue ( Element element, string property, Expression expression ) : Binder
BindVisibility ( Element element, string property, Expression expression ) : Binder
DetachBehaviors ( Element element ) : void

Detaches all behaviors associated with the specified element.

GetTypeKey ( Type type ) : string
ProcessModelExpression ( object model, string expressionType, string value ) : Expression
RegisterBehavior ( string name, Type behaviorType ) : void
SetupBindings ( Element element, object model ) : void
SetupServices ( ) : void

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

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

Compiles a template instance from the specified template type and content.
public CompileTemplate ( string type, string content, object>.Dictionary options ) : Template
type string The template engine to use to compile the template.
content string The template content.
options object>.Dictionary Any options to be passed to the template engine.
Результат Template

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

Deactivates the specified element and its children by disposing any behaviors or binding instances attached to the elements.
public DeactivateFragment ( Element element, bool contentOnly ) : void
element System.Html.Element The element to deactivate.
contentOnly bool Whether the element should be deactivated, or only its contained content.
Результат void

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

Gets an instance of the specified object type. An instance is created if one has not been registered with the container. A factory method is called if a factory has been registered or implemented on the object type.
public GetObject ( Type objectType ) : object
objectType System.Type The type of object to retrieve.
Результат object

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

Gets the value of the specified setting.
public GetSetting ( string name ) : string
name string The name of the setting.
Результат string

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

Gets a template instance from the specified template name. The specified name is used to lookup a script element with a matching id.
public GetTemplate ( string name ) : Template
name string The name to lookup a template.
Результат Template

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

Raises the specified event. The type of the event arguments is used to determine which subscribers the event is routed to.
public PublishEvent ( EventArgs eventArgs ) : void
eventArgs System.EventArgs The event arguments containing event-specific data.
Результат void

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

Registers a behavior so it can be used declaratively in markup.
public RegisterBehavior ( string name, Type behaviorType, Type serviceType ) : void
name string The unique name of the behavior.
behaviorType System.Type The type of the behavior.
serviceType System.Type An option service type associated with the behavior for auto-registration with the application container.
Результат void

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

Registers a binder factory. The supplied name prefixed with "data-" is used as the attribute name in markup to create a binder.
public RegisterBinder ( string name, BinderFactory factory ) : void
name string The name of the expression handler.
factory BinderFactory The factory being registered.
Результат void

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

Registers an expression factory. The supplied name is used in markup to represent an instance of the associated expression.
public RegisterExpression ( string name, ExpressionFactory factory ) : void
name string The name of expression.
factory ExpressionFactory The factory to be used to handle the supplied name.
Результат void

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

Registers an object factory with the container. The factory is called when the particular object type is requested. The factory can decide whether to cache object instances it returns or not, based on its policy.
public RegisterFactory ( Type objectType, Func objectFactory ) : void
objectType System.Type
objectFactory Func
Результат void

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

Registers an object instance for the specified object type.
public RegisterObject ( Type objectType, object objectInstance ) : void
objectType System.Type The type that can be used to lookup the specified object instance.
objectInstance object The object instance to use.
Результат void

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

Registers a service type.
public RegisterService ( string name, Type serviceImplementationType, Type serviceType ) : void
name string The name of the service.
serviceImplementationType System.Type The type providing the implementation of the service.
serviceType System.Type The type of the service.
Результат void

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

Registers a template with the specified name.
public RegisterTemplate ( string name, Template template ) : void
name string The name of template.
template Template The template to be used.
Результат void

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

Registers a template engine. The supplied name is used to match against the mime type attribute on a template script element.
public RegisterTemplateEngine ( string name, TemplateEngine engine ) : void
name string The name of template engine.
engine TemplateEngine The engine to be used to handle the supplied name.
Результат void

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

Subscribes to the specified type of events. The resulting cookie can be used for unsubscribing.
public SubscribeEvent ( Type eventType, Callback eventHandler ) : object
eventType System.Type The type of the event.
eventHandler Callback The event handler to invoke when the specified event type is raised.
Результат object

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

Unsubcribes from a previously subscribed-to event type.
public UnsubscribeEvent ( object subscriptionCookie ) : void
subscriptionCookie object The subscription cookie.
Результат void

Описание свойств

AutoInit публичное статическое свойство

Whether to automatically initialize the application once the page has loaded along with referenced scripts.
public static bool AutoInit
Результат bool

Current публичное статическое свойство

The current Application instance.
public static Application,Sharpen.Html Current
Результат Application