C# Class Spring.Globalization.AbstractLocalizer

Abstract base class that all localizers should extend

This class contains the bulk of the localizer logic, including implementation of the ApplyResources methods that are defined in ILocalizer interface.

All specific localizers need to do is inherit this class and implement GetResources method that will return a list of Resource objects that should be applied to a specified target.

Custom implementations can use whatever type of resource storage they want, such as standard .NET resource sets, custom XML files, database, etc.

Inheritance: ILocalizer
Afficher le fichier Open project: spring-projects/spring-net

Méthodes publiques

Méthode Description
ApplyResources ( object target, IMessageSource messageSource ) : void

Applies resources to the specified target object, using current thread's uiCulture to resolve resources.

ApplyResources ( object target, IMessageSource messageSource, CultureInfo culture ) : void

Applies resources of the specified culture to the specified target object.

Méthodes protégées

Méthode Description
LoadResources ( object target, IMessageSource messageSource, CultureInfo culture ) : IList

Loads resources from the storage and creates a list of Resource instances that should be applied to the target.

Private Methods

Méthode Description
GetResources ( object target, IMessageSource messageSource, CultureInfo culture ) : IList

Returns a list of Resource instances that should be applied to the target.

Method Details

ApplyResources() public méthode

Applies resources to the specified target object, using current thread's uiCulture to resolve resources.
public ApplyResources ( object target, IMessageSource messageSource ) : void
target object Target object to apply resources to.
messageSource IMessageSource instance to retrieve resources from.
Résultat void

ApplyResources() public méthode

Applies resources of the specified culture to the specified target object.
public ApplyResources ( object target, IMessageSource messageSource, CultureInfo culture ) : void
target object Target object to apply resources to.
messageSource IMessageSource instance to retrieve resources from.
culture System.Globalization.CultureInfo Resource culture to use for resource lookup.
Résultat void

LoadResources() protected abstract méthode

Loads resources from the storage and creates a list of Resource instances that should be applied to the target.
protected abstract LoadResources ( object target, IMessageSource messageSource, CultureInfo culture ) : IList
target object Target to get a list of resources for.
messageSource IMessageSource instance to retrieve resources from.
culture System.Globalization.CultureInfo Resource locale.
Résultat IList