Beispiel #1
0
        public AboutPresenter GetAboutPresenter()
        {
            AboutForm      view      = new AboutForm();
            AboutPresenter presenter = AboutPresenter.Instance;

            presenter.View = view;
            presenter.Init();
            return(presenter);
        }
        public MainPresenter CreateMainPresenter()
        {
            ToolbarView     toolbarView     = new ToolbarView();
            TextInputView   textInputView   = new TextInputView();
            WordCounterView wordCounterView = new WordCounterView();
            StatusBarView   statusBarView   = new StatusBarView();

            ToolbarModel toolbarModel = new ToolbarModel();
            //ToolbarPresenter toolbarPresenter = new ToolbarPresenter(toolbarView, toolbarModel);

            IModalDialogBuilder modalDialogBuilder = new ModalDialogBuilder();

            IFileSelectionView     fileSelectionView  = new FileSelectionView();
            FileSelectionModel     fileSelectionModel = new FileSelectionModel();
            FileSelectionPresenter openFilePresenter  = new FileSelectionPresenter(fileSelectionView, fileSelectionModel);

            TextInputModel     textInputModel     = new TextInputModel(fileSelectionModel);
            TextInputPresenter textInputPresenter = new TextInputPresenter(textInputView, textInputModel);

            WordFrequencyCounter wordFrequencyCounter = new WordFrequencyCounter();
            WordCounterModel     wordCounterModel     = new WordCounterModel(wordFrequencyCounter);
            WordCounterPresenter wordCounterPresenter = new WordCounterPresenter(wordCounterView, wordCounterModel);

            RunButtonNavigator runButtonNavigator = new RunButtonNavigator(toolbarView, wordCounterModel);

            MainView      mainView      = new MainView(toolbarView, textInputView, wordCounterView, statusBarView);
            MainModel     mainModel     = new MainModel();
            MainPresenter mainPresenter = new MainPresenter(mainView, mainModel);

            AboutView      aboutView      = new AboutView();
            AboutModel     aboutModel     = new AboutModel();
            AboutPresenter aboutPresenter = new AboutPresenter(aboutView, aboutModel);

            RunButtonNavigator   navigation           = new RunButtonNavigator(toolbarView, wordCounterModel);
            AboutButtonNavigator aboutButtonNavigator = new AboutButtonNavigator(toolbarView, aboutView);
            TextSynchronizer     modelConnector       = new TextSynchronizer(wordCounterModel, textInputModel);

            IFileSelectionDisplay fileSelectionDisplay = new FileSelectionDisplay(fileSelectionModel);

            ILoadTextFromFile           loadTextFromFile            = new LoadTextFromFile(fileSelectionDisplay);
            LoadTextFromFileToTextInput loadTextFromFileToTextInput = new LoadTextFromFileToTextInput(loadTextFromFile, textInputModel);
            FileSelectionNavigator      openFileButtonNavigator     = new FileSelectionNavigator(toolbarView, loadTextFromFileToTextInput);

            TextInputLoader textInputLoader = new TextInputLoader(textInputModel, fileSelectionModel);

            /*
             * Wyświetlanie MsgBox
             * Obsługa błędów otwarcia pliku
             */

            return(mainPresenter);
        }
        public PairTrackerPresenter(PairTrackerView view, PairingSession model, AboutPresenter aboutPresenter, SessionPercentageStatisticGenerator statGenerator, Repository <PairingSession> repository)
        {
            this.view           = view;
            this.model          = model;
            this.statGenerator  = statGenerator;
            this.repository     = repository;
            this.aboutPresenter = aboutPresenter;

            view.StartButton_Clicked += new EventHandler <StartButtonClickedEventArgs>(StartSession);
            view.StopButton_Clicked  += new EventHandler <EventArgs>(EndSession);
            view.Controller_Changed  += new EventHandler <ControllerChangedEventArgs>(ChangeControllerHandler);
            view.CloseButton_Clicked += new EventHandler <CloseButtonClickedEventArgs>(Close);
            view.About_Clicked       += new EventHandler <EventArgs>(ShowAbout);
            view.PauseButton_Clicked += new EventHandler <EventArgs>(PauseSession);
        }
        public PairTrackerPresenter(PairTrackerView view, PairingSession model, AboutPresenter aboutPresenter, SessionPercentageStatisticGenerator statGenerator, Repository<PairingSession> repository)
        {
            this.view = view;
            this.model = model;
            this.statGenerator = statGenerator;
            this.repository = repository;
            this.aboutPresenter = aboutPresenter;

            view.StartButton_Clicked += new EventHandler<StartButtonClickedEventArgs>(StartSession);
            view.StopButton_Clicked += new EventHandler<EventArgs>(EndSession);
            view.Controller_Changed += new EventHandler<ControllerChangedEventArgs>(ChangeControllerHandler);
            view.CloseButton_Clicked += new EventHandler<CloseButtonClickedEventArgs>(Close);
            view.About_Clicked += new EventHandler<EventArgs>(ShowAbout);
            view.PauseButton_Clicked += new EventHandler<EventArgs>(PauseSession);
        }
Beispiel #5
0
 public void Setup()
 {
     _viewMock  = new Mock <IAboutView>();
     _presenter = new AboutPresenter(_viewMock.Object, TestDbContext.Instance);
 }
Beispiel #6
0
 public PairTrackerPresenterBuilder WithAboutPresenter(AboutPresenter aboutPresenter)
 {
     this.aboutPresenter = aboutPresenter;
     return(this);
 }
 public PairTrackerPresenterBuilder WithAboutPresenter(AboutPresenter aboutPresenter)
 {
     this.aboutPresenter = aboutPresenter;
     return this;
 }
Beispiel #8
0
 public About()
 {
     _presenter = new AboutPresenter(this, DbContext);
 }