コード例 #1
0
ファイル: TestWindowModel.cs プロジェクト: SerheyDemchuk/E4Um
        public TestWindowModel(PopUp model, IWindowService openWindowService)
        {
            Model                 = model;
            BlockVolume           = SetBlockVolume();
            NewWordsCounter       = BlockVolume;
            InitialFillTestIndex  = 0;
            FillTestIndex         = 0;
            TestAppearCounter     = 0;
            IsDictionaryCompleted = false;
            //IsNewWord = true;
            PriorityReduсtionCounter   = 0;
            DictionaryRefreshCounter   = BlockVolume;
            DictionaryRefreshIndex     = BlockVolume;
            NextWordCounter            = 0;
            NewWordsAmount             = 0;
            FillTestNextWordIndex      = BlockVolume;
            TranslationClickCanExecute = true;
            CorrectAnswersCounter      = 0;
            IncorrectAnswersCounter    = 0;

            if (Model.IsTestOpenFirstly)
            {
                IsCountersVisible      = true;
                CurrentWordsDictionary = new Dictionary <string, double>();
                TermList        = Model.GetTermList();
                TranslationList = Model.GetTranslationList();
            }
            else
            {
                CurrentWordsDictionary = Model.GetCurrentWordsDictionary(BlockVolume);
                TermList        = Model.GetCurrentTermList(BlockVolume);
                TranslationList = Model.GetCurrentTranslationList(BlockVolume);
            }

            VariantsList = new List <Dictionary <string, bool> >();
            AnswerList   = new List <Dictionary <string, bool> >();

            InitialFillTest();
            this.openWindowService  = openWindowService;
            TranslationOneColor     = Color.FromArgb(255, 0, 0, 0);
            TranslationTwoColor     = Color.FromArgb(255, 0, 0, 0);
            TranslationThreeColor   = Color.FromArgb(255, 0, 0, 0);
            TranslationFourColor    = Color.FromArgb(255, 0, 0, 0);
            TranslationClickCommand = new RelayCommand(TranslationClickCommand_Execute, TranslationClickCommand_CanExecute);
        }