C# 클래스 LearnLanguages.Study.StudyItemViewModelFactory

The purpose of this class is to produce viewmodels given some input.
파일 보기 프로젝트 열기: ibgib/LearnLanguages

공개 메소드들

메소드 설명
ProcureAsync ( PhraseEdit phrase, string nativeLanguageText ) : Task

Creates a study item using the phrase and nativeLanguageText. If the phrase.Language is the same as the native language, then this will be a study item related to studying the meaning of the phrase, all in the native language. If these two languages are different, then it will procure a translation study item. This prepares the view model so that all that is necessary for the caller is to call viewmodel.Show(...);

비공개 메소드들

메소드 설명
AutoTranslate ( PhraseEdit untranslatedPhrase, string targetLanguageText ) : Task

Uses auto translation service (as of writing, this is BingTranslatorService) to translate phrase into another phrase, which is returned in the callback.

GetTranslatedPhrase ( PhraseEdit phrase, string targetLanguageText ) : Task>

First searches DB for translated phrase. If not found there, uses AutoTranslate.

메소드 상세

ProcureAsync() 공개 메소드

Creates a study item using the phrase and nativeLanguageText. If the phrase.Language is the same as the native language, then this will be a study item related to studying the meaning of the phrase, all in the native language. If these two languages are different, then it will procure a translation study item. This prepares the view model so that all that is necessary for the caller is to call viewmodel.Show(...);
public ProcureAsync ( PhraseEdit phrase, string nativeLanguageText ) : Task
phrase PhraseEdit
nativeLanguageText string
리턴 Task