public MainFormPresenter(IMainFormView mainFormView) { subscriptionView = mainFormView.SubscriptionView; episodeView = mainFormView.EpisodeView; podcastView = mainFormView.PodcastView; toolbarView = mainFormView.ToolbarView; this.mainFormView = mainFormView; mainFormView.Load += MainFormViewOnLoad; mainFormView.FormClosed += MainFormViewOnFormClosed; mainFormView.HelpRequested += OnHelpRequested; mainFormView.KeyUp += MainFormViewOnKeyUp; toolbarView.PlayClicked += OnButtonPlayClick; toolbarView.StopClicked += OnButtonStopClick; toolbarView.PauseClicked += OnButtonPauseClick; toolbarView.RemovePodcastClicked += OnButtonRemovePodcastClick; toolbarView.AddPodcastClicked += OnButtonAddSubscriptionClick; toolbarView.FavouriteChanged += OnButtonFavouriteCheckStateChanged; episodeView.Description = ""; episodeView.Title = ""; episodeView.PublicationDate = ""; subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; subscriptionManager = new SubscriptionManager("subscriptions.xml"); podcastLoader = new PodcastLoader(); podcastPlayer = new PodcastPlayer(); podcasts = subscriptionManager.LoadPodcasts(); if (!SystemInformation.HighContrast) { mainFormView.BackColor = Color.White; } }
public EpisodePresenter(IEpisodeView episodeView, IPodcastPlayer podcastPlayer) { this.episodeView = episodeView; this.podcastPlayer = podcastPlayer; episodeView.Title = ""; episodeView.PublicationDate = ""; this.episodeView.NoteCreated += EpisodeViewOnNoteCreated; episodeView.PositionChanged += (s, a) => podcastPlayer.PositionInSeconds = episodeView.PositionInSeconds; var timer = new Timer { Interval = 100 }; timer.Tick += TimerOnTick; timer.Start(); EventAggregator.Instance.Subscribe <EpisodeSelectedMessage>(OnEpisodeSelected); EventAggregator.Instance.Subscribe <PodcastSelectedMessage>(OnPodcastSelected); EventAggregator.Instance.Subscribe <ApplicationClosingMessage>(m => { SaveEpisode(); podcastPlayer.Dispose(); }); EventAggregator.Instance.Subscribe <PeaksAvailableMessage>(OnPeaksAvailable); }
public MainFormPresenter(IMainFormView mainFormView, IPodcastLoader podcastLoader, ISubscriptionManager subscriptionManager, IPodcastPlayer podcastPlayer, IMessageBoxDisplayService messageBoxDisplayService, ISettingsService settingsService, ISystemInformationService systemInformationService, IToolbarCommand[] commands) { this.podcastPlayer = podcastPlayer; this.subscriptionManager = subscriptionManager; this.podcastLoader = podcastLoader; this.messageBoxDisplayService = messageBoxDisplayService; this.settingsService = settingsService; this.commands = commands; subscriptionView = mainFormView.SubscriptionView; episodeView = mainFormView.EpisodeView; podcastView = mainFormView.PodcastView; this.mainFormView = mainFormView; mainFormView.Load += MainFormViewOnLoad; mainFormView.FormClosed += MainFormViewOnFormClosed; mainFormView.HelpRequested += OnHelpRequested; mainFormView.KeyUp += MainFormViewOnKeyUp; mainFormView.ToolbarView.SetCommands(commands); timer = new Timer(); timer.Interval = 100; timer.Tick += TimerOnTick; timer.Start(); episodeView.Title = ""; episodeView.Description = ""; episodeView.PubDate = ""; subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; if (!systemInformationService.IsHighContrastColourScheme) { mainFormView.BackColor = System.Drawing.Color.White; } subscriptionManager.LoadPodcasts(); episodeView.PositionChanged += (s, a) => podcastPlayer.PositionInSeconds = episodeView.PositionInSeconds; episodeView.NoteCreated += EpisodeViewOnNoteCreated; }
public MainFormPresenter(IMainFormView mainFormView, ISubscriptionManager subscriptionManager, IPodcastLoader podcastLoader, IPodcastPlayer podcastPlayer, IMessageBoxDisplayService messageBoxDisplayService, ISettingsService settingsService, ISystemInformationService systemInformationService, INewSubscriptionService newSubscriptionService) { _subscriptionView = mainFormView.SubscriptionView; _episodeView = mainFormView.EpisodeView; _podcastView = mainFormView.PodcastView; _timer = new Timer(); _timer.Interval = 100; _timer.Tick += TimerOnTick; _timer.Start(); _mainFormView = mainFormView; mainFormView.Load += OnMainFormLoad; mainFormView.FormClosed += OnMainFormClosed; mainFormView.KeyUp += MainFormViewOnKeyUp; _subscriptionView.AddPodcastClicked += OnButtonAddClick; _subscriptionView.RemovePodcastClicked += OnButtonRemoveClick; _subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; _episodeView.PlayClicked += OnButtonPlayClick; _episodeView.StopClicked += OnButtonStopClick; _subscriptionManager = subscriptionManager; _podcastLoader = podcastLoader; _podcastPlayer = podcastPlayer; _podcasts = _subscriptionManager.LoadPodcasts(); _settingsService = settingsService; _newSubscriptionService = newSubscriptionService; _messageBoxDisplayService = messageBoxDisplayService; if (systemInformationService.IsHighContrastColorScheme) { mainFormView.BackColor = Color.White; } _episodeView.PositionChanged += (s, a) => _podcastPlayer.PositionInSeconds = _episodeView.PositionInSeconds; }
public MainFormPresenter(IMainFormView mainFormView, IPodcastLoader podcastLoader, ISubscriptionManager subscriptionManager, IPodcastPlayer podcastPlayer, IMessageBoxDisplayService messageBoxDisplayService, ISettingsService settingsService, ISystemInformationService systemInformationService, INewSubscriptionService newSubscriptionService) { subscriptionView = mainFormView.SubscriptionView; episodeView = mainFormView.EpisodeView; podcastView = mainFormView.PodcastView; toolbarView = mainFormView.ToolbarView; this.mainFormView = mainFormView; mainFormView.Load += MainFormViewOnLoad; mainFormView.FormClosed += MainFormViewOnFormClosed; mainFormView.HelpRequested += OnHelpRequested; mainFormView.KeyUp += MainFormViewOnKeyUp; toolbarView.PlayClicked += OnButtonPlayClick; toolbarView.StopClicked += OnButtonStopClick; toolbarView.PauseClicked += OnButtonPauseClick; toolbarView.RemovePodcastClicked += OnButtonRemovePodcastClick; toolbarView.AddPodcastClicked += OnButtonAddSubscriptionClick; toolbarView.FavouriteChanged += OnButtonFavouriteCheckStateChanged; episodeView.Description = ""; episodeView.Title = ""; episodeView.PublicationDate = ""; subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; this.subscriptionManager = subscriptionManager; this.podcastLoader = podcastLoader; this.podcastPlayer = podcastPlayer; this.messageBoxDisplayService = messageBoxDisplayService; this.settingsService = settingsService; this.newSubscriptionService = newSubscriptionService; podcasts = subscriptionManager.LoadPodcasts(); if (!systemInformationService.IsHighContrastColourScheme) { mainFormView.BackColor = Color.White; } }
public MainFormPresenter(IMainFormView mainFormView, IPodcastLoader podcastLoader, ISubscriptionManager subscriptionManager, IPodcastPlayer podcastPlayer, IMessageBoxDisplayService messageBoxDisplayService, ISettingsService settingsService, ISystemInformationService systemInformationService, IToolbarCommand[] commands) { subscriptionView = mainFormView.SubscriptionView; episodeView = mainFormView.EpisodeView; podcastView = mainFormView.PodcastView; toolbarView = mainFormView.ToolbarView; toolbarView.SetCommands(commands); this.mainFormView = mainFormView; mainFormView.Load += MainFormViewOnLoad; mainFormView.FormClosed += MainFormViewOnFormClosed; mainFormView.HelpRequested += OnHelpRequested; mainFormView.KeyUp += MainFormViewOnKeyUp; episodeView.Description = ""; episodeView.Title = ""; episodeView.PublicationDate = ""; subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; this.subscriptionManager = subscriptionManager; this.podcastLoader = podcastLoader; this.podcastPlayer = podcastPlayer; this.messageBoxDisplayService = messageBoxDisplayService; this.settingsService = settingsService; this.commands = commands; if (!systemInformationService.IsHighContrastColourScheme) { mainFormView.BackColor = Color.White; } }