Пример #1
0
        static void Main()
        {
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += ApplicationOnThreadException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var mainForm                 = new MainForm();
            var subscriptionManager      = new SubscriptionManager("subscriptions.xml");
            var podcastLoader            = new PodcastLoader();
            var podcastPlayer            = new PodcastPlayer();
            var displayService           = new MessageBoxDisplayService();
            var settingsService          = new SettingsService();
            var systemInformationService = new SystemInformationService();
            var subscriptionService      = new NewSubscriptionService();
            var presenter                = new MainFormPresenter(mainForm,
                                                                 subscriptionManager,
                                                                 podcastLoader,
                                                                 podcastPlayer,
                                                                 displayService,
                                                                 settingsService,
                                                                 systemInformationService,
                                                                 subscriptionService);

            Application.Run(mainForm);
        }
Пример #2
0
        static void Main()
        {
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += ApplicationOnThreadException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var mainForm  = new MainForm();
            var presenter = new MainFormPresenter(mainForm);

            Application.Run(mainForm);
        }
Пример #3
0
        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 subscriptionManager      = new SubscriptionManager("subscriptions.xml");
            var podcastLoader            = new PodcastLoader();
            var podcastPlayer            = new PodcastPlayer();
            var messageBoxDisplayService = new MessageBoxDisplayService();
            var settingsService          = new SettingsService();
            var systemInformationService = new SystemInformationService();
            var newSubscriptionService   = new NewSubscriptionService();
            var mainFormView             = new MainForm();

            var commands = new IToolbarCommand[]
            {
                new AddSubscriptionCommand(mainFormView.SubscriptionView, messageBoxDisplayService, newSubscriptionService, podcastLoader, subscriptionManager),
                new RemoveSubscriptionCommand(mainFormView.SubscriptionView, subscriptionManager),
                new PlayCommand(podcastPlayer),
                new PauseCommand(podcastPlayer),
                new StopCommand(podcastPlayer),
                new FavouriteCommand(mainFormView.SubscriptionView),
                new SettingsCommand()
            };

            var mainFormPresenter = new MainFormPresenter(mainFormView,
                                                          podcastLoader,
                                                          subscriptionManager,
                                                          podcastPlayer,
                                                          messageBoxDisplayService,
                                                          settingsService,
                                                          systemInformationService,
                                                          commands);

            Application.Run(mainFormView);
        }