Ejemplo n.º 1
0
 public MainForm()
 {
     InitializeComponent();
     episodeView = new EpisodeView()
     {
         Dock = DockStyle.Fill
     };
     podcastView = new PodcastView()
     {
         Dock = DockStyle.Fill
     };
     subscriptionView = new SubscriptionView()
     {
         Dock = DockStyle.Fill
     };
     splitContainer1.Panel1.Controls.Add(subscriptionView);
     episodeView.labelDescription.Text                = "";
     episodeView.labelEpisodeTitle.Text               = "";
     episodeView.labelPublicationDate.Text            = "";
     subscriptionView.treeViewPodcasts.AfterSelect   += OnSelectedEpisodeChanged;
     subscriptionView.buttonAddSubscription.Click    += OnButtonAddSubscriptionClick;
     subscriptionView.buttonRemoveSubscription.Click += OnButtonRemovePodcastClick;
     episodeView.buttonPlay.Click += OnButtonPlayClick;
     if (!SystemInformation.HighContrast)
     {
         BackColor = Color.White;
     }
 }
 public MainForm()
 {
     InitializeComponent();
     episodeView = new EpisodeView()
     {
         Dock = DockStyle.Fill
     };
     podcastView = new PodcastView()
     {
         Dock = DockStyle.Fill
     };
     subscriptionView = new SubscriptionView()
     {
         Dock = DockStyle.Fill
     };
     splitContainer1.Panel1.Controls.Add(subscriptionView);
     episodeView.labelDescription.Text              = "";
     episodeView.labelEpisodeTitle.Text             = "";
     episodeView.labelPublicationDate.Text          = "";
     subscriptionView.treeViewPodcasts.AfterSelect += OnSelectedEpisodeChanged;
     if (!SystemInformation.HighContrast)
     {
         BackColor = Color.White;
     }
     subscriptionManager = new SubscriptionManager("subscriptions.xml");
     podcastLoader       = new PodcastLoader();
     podcastPlayer       = new PodcastPlayer();
 }
        static void Main()
        {
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += ApplicationOnThreadException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
            var culture = new CultureInfo("en");

            Thread.CurrentThread.CurrentUICulture     = culture;
            Thread.CurrentThread.CurrentCulture       = culture;
            CultureInfo.DefaultThreadCurrentUICulture = culture;
            CultureInfo.DefaultThreadCurrentCulture   = culture;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var episodeView      = new WpfEpisodeViewHost();
            var subscriptionView = new SubscriptionView();
            var podcastView      = new PodcastView();
            var toolbarView      = new ToolBarView();

            var podcastPlayer            = new PodcastPlayer();
            var podcastLoader            = new PodcastLoader();
            var settingsService          = new SettingsService();
            var subscriptionManager      = new SubscriptionManager("subscriptions.xml");
            var messageBoxDisplayService = new MessageBoxDisplayService();
            var systemInformationService = new SystemInformationService();
            var newSubscriptionService   = new NewSubscriptionService();

            var commands = new IToolbarCommand[]
            {
                new AddSubscriptionCommand(messageBoxDisplayService,
                                           newSubscriptionService,
                                           podcastLoader,
                                           subscriptionManager),
                new RemoveSubscriptionCommand(subscriptionView, subscriptionManager),
                new PlayCommand(podcastPlayer),
                new PauseCommand(podcastPlayer),
                new StopCommand(podcastPlayer),
                new FavouriteCommand(subscriptionView),
                new SettingsCommand()
            };
            var mainForm = new MainForm(episodeView, subscriptionView, podcastView, toolbarView);

            // for now, keep presenters alive with Tags
            episodeView.Tag      = new EpisodePresenter(episodeView, podcastPlayer);
            subscriptionView.Tag = new SubscriptionPresenter(subscriptionView);
            podcastView.Tag      = new PodcastPresenter(podcastView);
            toolbarView.Tag      = new ToolbarPresenter(toolbarView, commands);

            mainForm.Tag = new MainFormPresenter(mainForm,
                                                 podcastLoader,
                                                 subscriptionManager,
                                                 messageBoxDisplayService,
                                                 settingsService,
                                                 systemInformationService,
                                                 commands);
            Application.Run(mainForm);
        }
Ejemplo n.º 4
0
 public MainForm()
 {
     InitializeComponent();
     episodeView = new EpisodeView()
     {
         Dock = DockStyle.Fill
     };
     podcastView = new PodcastView()
     {
         Dock = DockStyle.Fill
     };
     subscriptionView = new SubscriptionView()
     {
         Dock = DockStyle.Fill
     };
     splitContainerMainForm.Panel1.Controls.Add(subscriptionView);
 }
Ejemplo n.º 5
0
 public MainForm()
 {
     InitializeComponent();
     episodeView = new EpisodeView()
     {
         Dock = DockStyle.Fill
     };
     podcastView = new PodcastView()
     {
         Dock = DockStyle.Fill
     };
     episodeView.labelDescription.Text                = "";
     episodeView.labelEpisodeTitle.Text               = "";
     episodeView.labelPublicationDate.Text            = "";
     subscriptionView.treeViewPodcasts.AfterSelect   += OnSelectedEpisodeChanged;
     subscriptionView.buttonAddSubscription.Click    += OnButtonAddSubscriptionClick;
     subscriptionView.buttonRemoveSubscription.Click += OnButtonRemovePodcastClick;
     episodeView.buttonPlay.Click += OnButtonPlayClick;
 }