C# 클래스 Illusion.ViewModelLocator

A strategy for determining which view model to use for a given view.
파일 보기 프로젝트 열기: kasicass/kasicass

공개 프로퍼티들

프로퍼티 타입 설명
InterfaceCaptureGroupName string
LocateForView object>.Func
LocateForViewType object>.Func
LocateTypeForViewType Func
NameTransformer NameTransformer
TransformName Func>

공개 메소드들

메소드 설명
AddDefaultTypeMapping ( string viewSuffix = "View" ) : void

Adds a default type mapping using the standard namespace mapping convention

AddNamespaceMapping ( string nsSource, string nsTargets, string viewSuffix = "View" ) : void

Adds a standard type mapping based on simple namespace mapping

AddSubNamespaceMapping ( string nsSource, string nsTargets, string viewSuffix = "View" ) : void

Adds a standard type mapping by substituting one subnamespace for another

AddTypeMapping ( string nsSourceReplaceRegEx, string nsSourceFilterRegEx, string nsTargetsRegEx, string viewSuffix = "View" ) : void

Adds a standard type mapping based on namespace RegEx replace and filter patterns

ConfigureTypeMappings ( TypeMappingConfiguration config ) : void

Specifies how type mappings are created, including default type mappings. Calling this method will clear all existing name transformation rules and create new default type mappings according to the configuration.

MakeInterface ( string typeName ) : string

Makes a type name into an interface name.

비공개 메소드들

메소드 설명
SetAllDefaults ( ) : void
ViewModelLocator ( ) : System

메소드 상세

AddDefaultTypeMapping() 공개 정적인 메소드

Adds a default type mapping using the standard namespace mapping convention
public static AddDefaultTypeMapping ( string viewSuffix = "View" ) : void
viewSuffix string Suffix for type name. Should be "View" or synonym of "View". (Optional)
리턴 void

AddNamespaceMapping() 공개 정적인 메소드

Adds a standard type mapping based on simple namespace mapping
public static AddNamespaceMapping ( string nsSource, string nsTargets, string viewSuffix = "View" ) : void
nsSource string Namespace of source type
nsTargets string Namespaces of target type as an array
viewSuffix string Suffix for type name. Should be "View" or synonym of "View". (Optional)
리턴 void

AddSubNamespaceMapping() 공개 정적인 메소드

Adds a standard type mapping by substituting one subnamespace for another
public static AddSubNamespaceMapping ( string nsSource, string nsTargets, string viewSuffix = "View" ) : void
nsSource string Subnamespace of source type
nsTargets string Subnamespaces of target type as an array
viewSuffix string Suffix for type name. Should be "View" or synonym of "View". (Optional)
리턴 void

AddTypeMapping() 공개 정적인 메소드

Adds a standard type mapping based on namespace RegEx replace and filter patterns
public static AddTypeMapping ( string nsSourceReplaceRegEx, string nsSourceFilterRegEx, string nsTargetsRegEx, string viewSuffix = "View" ) : void
nsSourceReplaceRegEx string RegEx replace pattern for source namespace
nsSourceFilterRegEx string RegEx filter pattern for source namespace
nsTargetsRegEx string Array of RegEx replace values for target namespaces
viewSuffix string Suffix for type name. Should be "View" or synonym of "View". (Optional)
리턴 void

ConfigureTypeMappings() 공개 정적인 메소드

Specifies how type mappings are created, including default type mappings. Calling this method will clear all existing name transformation rules and create new default type mappings according to the configuration.
public static ConfigureTypeMappings ( TypeMappingConfiguration config ) : void
config TypeMappingConfiguration An instance of TypeMappingConfiguration that provides the settings for configuration
리턴 void

MakeInterface() 공개 정적인 메소드

Makes a type name into an interface name.
public static MakeInterface ( string typeName ) : string
typeName string The part.
리턴 string

프로퍼티 상세

InterfaceCaptureGroupName 공개적으로 정적으로 프로퍼티

The name of the capture group used as a marker for rules that return interface types
public static string InterfaceCaptureGroupName
리턴 string

LocateForView 공개적으로 정적으로 프로퍼티

Locates the view model for the specified view instance.
Pass the view instance as a parameters and receive a view model instance.
public static Func LocateForView
리턴 object>.Func

LocateForViewType 공개적으로 정적으로 프로퍼티

Locates the view model for the specified view type.
Pass the view type as a parameter and receive a view model instance.
public static Func LocateForViewType
리턴 object>.Func

LocateTypeForViewType 공개적으로 정적으로 프로퍼티

Determines the view model type based on the specified view type.
Pass the view type and receive a view model type. Pass true for the second parameter to search for interfaces.
public static Func LocateTypeForViewType
리턴 Func

NameTransformer 공개적으로 정적으로 프로퍼티

Used to transform names.
public static NameTransformer NameTransformer
리턴 NameTransformer

TransformName 공개적으로 정적으로 프로퍼티

Transforms a View type name into all of its possible ViewModel type names. Accepts a flag to include or exclude interface types.
Arguments: typeName = The name of the View type being resolved to its companion ViewModel. includeInterfaces = Flag to indicate if interface types are included
public static Func> TransformName
리턴 Func>