Ejemplo n.º 1
0
        public WordEditorVM(DictionaryEditorVM parentVM, Word word)
        {
            this.Word = word;
            this.DictionaryEditorVM = parentVM;
            this.wordStorage = DIContainer.Instance.Get<IWordStorage>();

            if (this.Word == null)
            {
                this.Word = new Word() { ID = Guid.NewGuid(), Language = MainVM.Instance.Language };
                this.isNewWord = true;
            }
            else
                this.Word.SavePointer.MakeSavePoint();

            this.SaveTranslationCmd = new Command(SaveTranslation);
            this.AddTranslationCmd = new Command(AddTranslation);
            this.DeleteTranslationCmd = new Command(DeleteTranslation);
            this.MoveTranslationUpCmd = new Command(MoveTranslationUp);
            this.MoveTranslationDownCmd = new Command(MoveTranslationDown);

            this.SavePhraseCmd = new Command(SavePhrase);
            this.AddPhraseCmd = new Command(AddPhrase);
            this.DeletePhraseCmd = new Command(DeletePhrase);

            this.SaveCmd = new Command(Save);
            this.CancelCmd = new Command(Cancel);
        }
 public WordSessionProvider(IWordStorage wordStorage, IStorage<WordResult> wordResultStorage, int sessionWordCount, byte customWordPercent)
 {
     this.WordStorage = wordStorage;
     this.WordResultStorage = wordResultStorage;
     this.sessionWordCount = sessionWordCount;
     this.customWordPercent = customWordPercent;
 }
Ejemplo n.º 3
0
 public Trainer(IWordStorage wordStorage, IStorage<WordResult> wordResultStorage, Language language, IWordSessionProvider wordSessionProvider, IScheduleBuilder scheduleBuilder, int penaltyRepetitionCount)
 {
     this.wordStorage = wordStorage;
     this.wordResultStorage = wordResultStorage;
     this.Language = language;
     this.wordSessionProvider = wordSessionProvider;
     this.scheduleBuilder = scheduleBuilder;
     this.penaltyRepetitionCount = penaltyRepetitionCount;
 }
        public DictionaryEditorVM(Word word = null)
        {
            this.WordStorage = DIContainer.Instance.Get<IWordStorage>();

            this.SaveCmd = new Command(Save);
            this.CancelCmd = new Command(Cancel);
            this.AddWordCmd = new Command(AddWord);
            this.EditWordCmd = new Command(EditWord);
            this.DeleteWordCmd = new Command(DeleteWord);

            this.WordStorage.Reopen();
            this.Words = new ObservableCollection<Word>(this.WordStorage.GetWordsByLanguage(MainVM.Instance.Language));

            if (word != null)
                this.GoToWord(word);
        }
Ejemplo n.º 5
0
        public MainVM(IWordStorage wordStorage, IStorage<WordResult> wordResultStorage, TrainerVM trainerVM, Language language, Language nativeLanguage)
        {
            this.WordStorage = wordStorage;
            this.WordResultStorage = wordResultStorage;

            this.Language = language;
            this.NativeLanguage = nativeLanguage;

            this.TrainerVM = trainerVM;

            this.Exit = new Command((o) =>
            {
                if (this.OnExitApp != null)
                    this.OnExitApp(this, EventArgs.Empty);
            });

            this.OpenEditorCmd = new Command(this.OpenEditor);
        }
Ejemplo n.º 6
0
 public BotService(ILogger logger, IWordStorage wordStorage, IGameStateService stateService) : base(logger)
 {
     this.wordStorage = wordStorage;
     this.gameState   = stateService.GetOrCreateGameState();
 }
Ejemplo n.º 7
0
 public ValidWordVerifier(ILogger logger, IWordStorage wordStorage) : base(logger)
 {
     this.wordStorage = wordStorage;
 }
Ejemplo n.º 8
0
 public Trainer4Test(IWordStorage wordStorage, IStorage<WordResult> wordResultStorage, Language language, IWordSessionProvider wordSessionProvider, IScheduleBuilder scheduleBuilder)
     : base(wordStorage, wordResultStorage, language, wordSessionProvider, scheduleBuilder, 1)
 {
 }
Ejemplo n.º 9
0
 public frmMain(IWordStorage storage)
 {
     _storage = storage;
     InitializeComponent();
     UpdateData();
 }