public WordLearnChoicePresenter(IWordLearningChoiceView ChoiceWindow, int userId)
 {
     model  = new WordLearnChoiceModel(userId);
     win    = ChoiceWindow;
     border = new BorderPresenter(win);
     win.Border_MouseLeftButtonDown += new EventHandler(BorderMouseLeftClick);
     win.Grid_MouseRightButtonDown  += new EventHandler(GridMouseRightClick);
     this.userId = userId;
 }
 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);
 }
Ejemplo n.º 4
0
 public TestPresenter(ITestView win, int userId, TestsModel test)
 {
     window      = win;
     model       = test;
     this.userId = userId;
     border      = new BorderPresenter(win);
     window.SetAllQuestions(model.Questions);
     count = 0;
     SetData();
     answers = new Dictionary <int, string>();
     window.Border_MouseLeftButtonDown     += window_Border_MouseLeftButtonDown;
     window.NextBorder_MouseLeftButtonDown += window_NextBorder_MouseLeftButtonDown;
 }
        public GroupsPresenter(IGroupsView GroupsWindow, int userId)
        {
            this.userId = userId;
            model       = new GroupsModel();
            win         = GroupsWindow;
            border      = new BorderPresenter(win);
            win.Border_MouseLeftButtonDown += new EventHandler(BorderMouseLeftClick);
            win.Grid_MouseRightButtonDown  += new EventHandler(GridMouseRightClick);
            //GenerateContent();
            List <GroupModel> constGroups = model.Groups;

            win.GenerateContent(constGroups);
        }
 public LectionChoicePresenter(ILectionChoiceView win, int userId)
 {
     model  = new LectionsChoiceModel();
     window = win;
     border = new BorderPresenter(window);
     if (model.Lections.Count == 0)
     {
         window.SendMessage("Лекции отсутствуют");
         (win as Window).Close();
     }
     window.Item_DoubleClick += Item_DoubleClick;
     win.SetData(CreateTreeData(model.Lections));
     this.userId = userId;
 }
 public CreateTestPresenter(ICreateTestView win, int userId)
 {
     window                          = win;
     border                          = new BorderPresenter(win);
     model                           = new CreateTestModel(userId);
     win.AddQuest_Click             += win_AddQuest_Click;
     win.Border_MouseLeftButtonDown += win_Border_MouseLeftButtonDown;
     win.AddAnswer_Click            += win_AddAnswer_Click;
     win.Btn_SaveClick              += win_Btn_SaveClick;
     win.Btn_DeleteClick            += win_Btn_DeleteClick;
     win.Complete_Click             += win_Complete_Click;
     win.End_Click                  += win_End_Click;
     questionCount                   = 0;
 }
Ejemplo n.º 8
0
 public TestResultPresenter(ITestResultView win, int userId, TestsModel test, bool save)
 {
     this.userId = userId;
     window      = win;
     model       = new TestResultModel(userId, test);
     if (save)
     {
         model.SaveResult();
     }
     border = new BorderPresenter(win);
     window.SetPercent(model.Percent);
     window.SetMainData(model.TestData);
     window.Border_MouseLeftButtonDown += window_Border_MouseLeftButtonDown;
     window.Window_StateChanged        += window_Window_StateChanged;
 }
Ejemplo n.º 9
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();
 }
        public GroupWordsPresenter(IGroupWordsView window, int userId, int groupId)
        {
            win    = window;
            border = new BorderPresenter(window);
            model  = new GroupWordsModel(userId, groupId);
            //EventManager.RegisterRoutedEvent("ButtonMouseLeftClick", RoutingStrategy.Direct, typeof(RoutedEventHandler), GroupWordsPresenter);
            win.Button_MouseLeftButtonUp += new EventHandler(ButtonMouseLeftClick);
            win.Btn_Add_Click            += new EventHandler(ButtonAddClick);
            win.Btn_Exit_Click           += new EventHandler(ButtonExitClick);
            win.Btn_Search_Click         += win_Btn_Search_Click;
            win.ChBx_Checked             += win_ChBx_Checked;
            List <WordModel> words = model.Words;

            UpdateWindow();
            UpdateOldWords();
        }