Beispiel #1
0
        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);

            timer          = new Timer();
            timer.Interval = 100;
            timer.Tick    += TimerOnTick;
            timer.Start();

            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;
            this.episodeView.NoteCreated += EpisodeViewOnNoteCreated;

            if (!systemInformationService.IsHighContrastColourScheme)
            {
                mainFormView.BackColor = Color.White;
            }

            episodeView.PositionChanged += (s, a) => podcastPlayer.PositionInSeconds = episodeView.PositionInSeconds;
        }
 /// <summary>Initializes a new instance of the <see cref="ToolbarPresenter"/> class.</summary>
 /// <param name="view">The view.</param>
 /// <param name="commands">The commands.</param>
 public ToolbarPresenter(IToolbarView view, List<IToolbarCommand> commands)
 {
     this.view = view;
     view.SetCommands(commands);
 }
 public ToolbarPresenter(IToolbarView toolbarView, IToolbarCommand[] commands)
 {
     toolbarView.SetCommands(commands);
 }
 /// <summary>Initializes a new instance of the <see cref="ToolbarPresenter"/> class.</summary>
 /// <param name="view">The view.</param>
 /// <param name="commands">The commands.</param>
 public ToolbarPresenter(IToolbarView view, List <IToolbarCommand> commands)
 {
     this.view = view;
     view.SetCommands(commands);
 }