C# 클래스 Griffin.MvcContrib.SqlServer.Localization.SqlLocalizedTypesRepository

Used to localize types
상속: ILocalizedTypesRepository, ITypePromptImporter
파일 보기 프로젝트 열기: jgauffin/griffin.mvccontrib 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_db ILocalizationDbContext

공개 메소드들

메소드 설명
CreateLanguage ( CultureInfo culture, CultureInfo templateCulture ) : void

Create translation for a new language

Delete ( CultureInfo culture, TypePromptKey key ) : void

Delete a prompt.

GetAvailableLanguages ( ) : IEnumerable

Get all languages that got partial or full translations.

GetPrompt ( CultureInfo culture, TypePromptKey key ) : TypePrompt

Get a specific prompt

GetPrompts ( CultureInfo cultureInfo, CultureInfo defaultCulture, Griffin.MvcContrib.Localization.SearchFilter filter ) : IEnumerable

Get all prompts

Import ( IEnumerable prompts ) : void

Import prompts into the repository.

Batch for inserting/updating several rows.

This method is not database engine independent (it uses SqlServers MERGE INTO). You must override it to add support for other databases than SqlServer (for instance using REPLACE INTO in MySQL)

Save ( CultureInfo culture, string fullTypeName, string name, string translatedText ) : void

Create or update a prompt

SqlLocalizedTypesRepository ( ILocalizationDbContext db ) : System

Initializes a new instance of the SqlLocalizedTypesRepository class.

Update ( CultureInfo culture, TypePromptKey key, string translatedText ) : void

Update translation

비공개 메소드들

메소드 설명
Create ( CultureInfo culture, string fullTypeName, string name, string translatedText ) : void
Exists ( CultureInfo culture, TypePromptKey key ) : bool
MapEntity ( IDataRecord record ) : TypePrompt
Save ( CultureInfo culture, Type type, string name, string translatedText ) : void

메소드 상세

CreateLanguage() 공개 메소드

Create translation for a new language
public CreateLanguage ( CultureInfo culture, CultureInfo templateCulture ) : void
culture System.Globalization.CultureInfo Language to create
templateCulture System.Globalization.CultureInfo Language to use as a template
리턴 void

Delete() 공개 메소드

Delete a prompt.
public Delete ( CultureInfo culture, TypePromptKey key ) : void
culture System.Globalization.CultureInfo Culture to delete prompt in
key TypePromptKey Prompt key
리턴 void

GetAvailableLanguages() 공개 메소드

Get all languages that got partial or full translations.
public GetAvailableLanguages ( ) : IEnumerable
리턴 IEnumerable

GetPrompt() 공개 메소드

Get a specific prompt
public GetPrompt ( CultureInfo culture, TypePromptKey key ) : TypePrompt
culture System.Globalization.CultureInfo Culture to get prompt for
key TypePromptKey Key which is unique in the current language
리턴 TypePrompt

GetPrompts() 공개 메소드

Get all prompts
public GetPrompts ( CultureInfo cultureInfo, CultureInfo defaultCulture, Griffin.MvcContrib.Localization.SearchFilter filter ) : IEnumerable
cultureInfo System.Globalization.CultureInfo Culture to get prompts for
defaultCulture System.Globalization.CultureInfo Culture used as template to be able to include all non-translated prompts
filter Griffin.MvcContrib.Localization.SearchFilter The filter.
리턴 IEnumerable

Import() 공개 메소드

Import prompts into the repository.

Batch for inserting/updating several rows.

This method is not database engine independent (it uses SqlServers MERGE INTO). You must override it to add support for other databases than SqlServer (for instance using REPLACE INTO in MySQL)

public Import ( IEnumerable prompts ) : void
prompts IEnumerable Prompts to import
리턴 void

Save() 공개 메소드

Create or update a prompt
public Save ( CultureInfo culture, string fullTypeName, string name, string translatedText ) : void
culture System.Globalization.CultureInfo Culture that the prompt is for
fullTypeName string Type.FullName for the type being localized
name string Property name and any additonal names (such as metadata name, use underscore as delimiter)
translatedText string Translated text string
리턴 void

SqlLocalizedTypesRepository() 공개 메소드

Initializes a new instance of the SqlLocalizedTypesRepository class.
public SqlLocalizedTypesRepository ( ILocalizationDbContext db ) : System
db ILocalizationDbContext Database connection.
리턴 System

Update() 공개 메소드

Update translation
public Update ( CultureInfo culture, TypePromptKey key, string translatedText ) : void
culture System.Globalization.CultureInfo Culture that the prompt is for
key TypePromptKey Unique key, in the specified language only, for the prompt to get)
translatedText string Translated text string
리턴 void

프로퍼티 상세

_db 보호되어 있는 프로퍼티

database context
protected ILocalizationDbContext _db
리턴 ILocalizationDbContext