public EquivalentPresenter(IEquivalentView window, int userId) : base(window, userId)
 {
     rand  = new Random();
     model = new TranslateModel(userId, "equivalent");
     win.Variant_MouseLeftButtonDown += new EventHandler(VariantMouseLeftDown);
     GenerateContent();
 }
예제 #2
0
 public ListeningPresenter(IEquivalentView window, int userId) : base(window, userId)
 {
     rand  = new Random();
     model = new TranslateModel(userId, "listening");
     flag  = false;
     GenerateContent();
 }
 void WindowClosing(object sender, EventArgs e)
 {
     border = null;
     win.Image_MouseLeftButtonDown -= new EventHandler(ImageMouseLeftClick);
     win.MediaEnded -= new EventHandler(MediaEnded);
     win.Next_MouseLeftButtonDown     -= new EventHandler(NextMouseLeftDown);
     win.Complete_MouseLeftButtonDown -= new EventHandler(CompleteMouseLeftDown);
     win.Window_Closing -= new EventHandler(WindowClosing);
     ClearGrid();
     answer = null;
     win    = null;
 }
 public ExercisePresenter(IEquivalentView window, int userId)
 {
     rand        = new Random();
     win         = window;
     border      = new BorderPresenter(win);
     rightAnswer = new List <int>();
     win.Image_MouseLeftButtonDown += new EventHandler(ImageMouseLeftClick);
     win.MediaEnded += new EventHandler(MediaEnded);
     //win.Variant_MouseLeftButtonDown += new EventHandler(VariantMouseLeftDown);
     win.Next_MouseLeftButtonDown     += new EventHandler(NextMouseLeftDown);
     win.Complete_MouseLeftButtonDown += new EventHandler(CompleteMouseLeftDown);
     win.Window_Closing += new EventHandler(WindowClosing);
 }
예제 #5
0
 public ConstructorPresenter(IEquivalentView window, int userId)
 {
     this.window = window;
     borderPresenter = new BorderPresenter(window);
     rand = new Random();
     rightAnswers = new List<int>();
     flag = false;
     userAnswer = new char[1];
     model = new TranslateModel(userId, "constructor");
     window.Window_Closing += new EventHandler(WindowClosing);
     window.Next_MouseLeftButtonDown += new EventHandler(NextMouseLeftDown);
     window.Variant_MouseLeftButtonDown += new EventHandler(VariantMouseLeftDown);
     window.Complete_MouseLeftButtonDown += new EventHandler(CompleteMouseLeftDown);
     GenerateContent();
 }
예제 #6
0
        //TODO: better change all number to variables, for example change 5 to variable answer number

        public SynonymsPresenter(IEquivalentView window, int userId)
            : base(window, userId)
        {
            rand    = new Random();
            model   = new SynonymsModel(userId);
            realNum = model.Synonyms.Count;
            if (realNum < 2)
            {
                window.SendMessage("Не найдено синонимов для изучаемых слов.");
                //MessageBox.Show("Не найдено синонимов для изучаемых слов.");
                (win as Window).Close();
                return;
            }
            win.Variant_MouseLeftButtonDown += new EventHandler(VariantMouseLeftDown);
            GenerateContent();
        }