C# 클래스 DotNetify.VMController

This class manages instantiations and updates of view models as requested by browser clients.
상속: IDisposable
파일 보기 프로젝트 열기: dsuryd/dotNetify 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_activeVMs VMInfo>.ConcurrentDictionary
_registeredAssemblies List
_vmResponse VMResponseDelegate
_vmTypes List

공개 메소드들

메소드 설명
Dispose ( ) : void

Disposes active view models.

OnDisposeVM ( string connectionId, string vmId ) : void

Handles request from a browser client to remove a view model.

OnRequestVM ( string connectionId, string vmId, object vmArg = null ) : void

Handles a request for a view model from a browser client.

OnUpdateVM ( string connectionId, string vmId, object>.Dictionary data ) : void

Handles view model update from a browser client.

RegisterAssembly ( Assembly vmAssembly ) : void

Registers all view model types in an assembly.

VMController ( VMResponseDelegate vmResponse ) : System

Constructor.

보호된 메소드들

메소드 설명
CreateVM ( string vmId, object vmArg = null ) : BaseVM

Creates a view model.

IsAuthorized ( BaseVM vmInstance ) : bool

Returns whether current security context is authorized to access a view model.

PushUpdates ( ) : void

Push property changed updates on all view models back to the client.

Serialize ( object data ) : string

Serializes an object.

UpdateVM ( BaseVM vmInstance, string vmPath, string newValue ) : void

Updates a value of a view model.

비공개 메소드들

메소드 설명
VmInstance_RequestPushUpdates ( object sender, EventArgs e ) : void

Handles push updates request from a view model.

메소드 상세

CreateVM() 보호된 메소드

Creates a view model.
protected CreateVM ( string vmId, object vmArg = null ) : BaseVM
vmId string Identifies the view model.
vmArg object Optional view model's initialization argument.
리턴 BaseVM

Dispose() 공개 메소드

Disposes active view models.
public Dispose ( ) : void
리턴 void

IsAuthorized() 보호된 메소드

Returns whether current security context is authorized to access a view model.
protected IsAuthorized ( BaseVM vmInstance ) : bool
vmInstance BaseVM View model instance.
리턴 bool

OnDisposeVM() 공개 메소드

Handles request from a browser client to remove a view model.
public OnDisposeVM ( string connectionId, string vmId ) : void
connectionId string Identifies the client connection.
vmId string Identifies the view model.
리턴 void

OnRequestVM() 공개 메소드

Handles a request for a view model from a browser client.
public OnRequestVM ( string connectionId, string vmId, object vmArg = null ) : void
connectionId string Identifies the client connection.
vmId string Identifies the view model.
vmArg object Optional view model's initialization argument.
리턴 void

OnUpdateVM() 공개 메소드

Handles view model update from a browser client.
public OnUpdateVM ( string connectionId, string vmId, object>.Dictionary data ) : void
connectionId string Identifies the client connection.
vmId string Identifies the view model.
data object>.Dictionary
리턴 void

PushUpdates() 보호된 메소드

Push property changed updates on all view models back to the client.
protected PushUpdates ( ) : void
리턴 void

RegisterAssembly() 공개 정적인 메소드

Registers all view model types in an assembly.
public static RegisterAssembly ( Assembly vmAssembly ) : void
vmAssembly System.Reflection.Assembly Assembly.
리턴 void

Serialize() 보호된 메소드

Serializes an object.
protected Serialize ( object data ) : string
data object Data to serialize.
리턴 string

UpdateVM() 보호된 메소드

Updates a value of a view model.
protected UpdateVM ( BaseVM vmInstance, string vmPath, string newValue ) : void
vmInstance BaseVM View model instance.
vmPath string View model property path.
newValue string New value.
리턴 void

VMController() 공개 메소드

Constructor.
public VMController ( VMResponseDelegate vmResponse ) : System
vmResponse VMResponseDelegate Function invoked by the view model to provide response back to the client.
리턴 System

프로퍼티 상세

_activeVMs 보호되어 있는 프로퍼티

Active instances of view models.
protected ConcurrentDictionary _activeVMs
리턴 VMInfo>.ConcurrentDictionary

_registeredAssemblies 보호되어 있는 정적으로 프로퍼티

List of registered assemblies.
protected static List _registeredAssemblies
리턴 List

_vmResponse 보호되어 있는 프로퍼티

Function invoked by the view model to provide response back to the client.
protected VMResponseDelegate _vmResponse
리턴 VMResponseDelegate

_vmTypes 보호되어 있는 정적으로 프로퍼티

List of known view model classes.
protected static List _vmTypes
리턴 List