public FavouriteCommand(ISubscriptionView subscriptionView) { this.subscriptionView = subscriptionView; ToolTip = "Favourite"; SetIcon(); subscriptionView.SelectionChanged += OnSubscriptionViewSelectionChanged; }
public static void SelectFirstEpisode(ISubscriptionView subscriptionView, ISubscriptionManager subscriptionManager) { if (!subscriptionView.IsEmpty()) { subscriptionView.SelectNode(subscriptionManager.Podcasts.SelectMany(p => p.Episodes).First().Guid); } }
public RemoveSubscriptionCommand(ISubscriptionView subscriptionView, ISubscriptionManager subscriptionManager) { this.subscriptionView = subscriptionView; this.subscriptionManager = subscriptionManager; Icon = IconResources.remove_icon_32; ToolTip = "Play"; }
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 FavouriteCommand(ISubscriptionView subscriptionView) { this.subscriptionView = subscriptionView; Icon = IconResources.star_icon_32; ToolTip = "Favourite"; subscriptionView.SelectionChanged += SubscriptionViewOnSelectionChanged; }
public SubscriptionPresenter(ISubscriptionView subscriptionView) { this.subscriptionView = subscriptionView; subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; EventAggregator.Instance.Subscribe <PodcastLoadedMessage>(m => AddPodcastToTreeView(m.Podcast)); EventAggregator.Instance.Subscribe <PodcastLoadCompleteMessage>(m => SelectFirstEpisode(m.Subscriptions)); }
public SubscriptionPresenter(ISubscriptionView subscriptionView, IPodcastPlayer podcastPlayer) { this.subscriptionView = subscriptionView; this.podcastPlayer = podcastPlayer; subscriptionView.SelectionChanged += OnSelectedEpisodeChanged; EventAggregator.Instance.Subscribe <PodcastLoadedMessage>(m => AddPodcastToTreeView(m.Podcast)); EventAggregator.Instance.Subscribe <PodcastLoadCompleteMessage>(m => subscriptionView.SelectNode(m.Subscriptions.SelectMany(p => p.Episodes).First().Guid)); }
public SubscriptionPresenter(ISubscriptionManager subscriptionManager, IGroupManager groupManager, IMessager messager, IClientManager clientManager, ISubscriptionView view) { this.view = view; this.groupManager = groupManager; this.subscriptionManager = subscriptionManager; this.messager = messager; this.clientManager = clientManager; view.AddNewSubscription += new EventHandler(view_AddNewSubscription); view.Refresh += new EventHandler(view_Refresh); view.AddNewSubscription += view_Refresh; view.CloseSubscription += View_CloseSubscription; view.ChangeSubscription += View_ChangeSubscription; view.RemoveSubscription += new EventHandler(view_RemoveSubscription); }
public AddSubscriptionCommand(ISubscriptionView subscriptionView, IMessageBoxDisplayService messageBoxDisplayService, INewSubscriptionService newSubscriptionService, IPodcastLoader podcastLoader, ISubscriptionManager subscriptionManager) { this.subscriptionView = subscriptionView; this.messageBoxDisplayService = messageBoxDisplayService; this.newSubscriptionService = newSubscriptionService; this.podcastLoader = podcastLoader; this.subscriptionManager = subscriptionManager; Icon = IconResources.add_icon_32; ToolTip = "Add Subscription"; }
public static void AddPodcastToSubscriptionView(ISubscriptionView subscriptionView, Podcast podcast) { var podcastNode = new TreeNode(podcast.Title) { Tag = podcast, Name = podcast.Id.ToString() }; foreach (var episode in podcast.Episodes) { podcastNode.Nodes.Add(new TreeNode(episode.Title) { Tag = episode, Name = episode.Guid }); } subscriptionView.AddNode(podcastNode); }
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; } }
public static void SelectFirstEpisode(ISubscriptionView subscriptionView, ISubscriptionManager subscriptionManager) { subscriptionView.SelectNode(subscriptionManager.Subscriptions.SelectMany(p => p.Episodes).First().Guid); }