Exemple #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            using (Scheduler = new TaskScheduler(JobQueue.WindowsMessageBased))
                using (ErrorList = new ErrorListDialog()) {
                    Scheduler.ErrorHandler = OnTaskError;

                    Preferences = new Tangle <object>(
                        Scheduler, CreatePreferencesStorage()
                        );

                    using (var f = Scheduler.Start(MainTask(), TaskExecutionPolicy.RunAsBackgroundTask)) {
                        f.RegisterOnComplete((_) => {
                            if (_.Failed)
                            {
                                Application.Exit();
                            }
                        });

                        Application.Run();
                    }
                }
        }
Exemple #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            using (Scheduler = new TaskScheduler(JobQueue.WindowsMessageBased))
            using (ErrorList = new ErrorListDialog()) {
                Scheduler.ErrorHandler = OnTaskError;

                Preferences = new Tangle<object>(
                    Scheduler, CreatePreferencesStorage()
                );

                using (var f = Scheduler.Start(MainTask(), TaskExecutionPolicy.RunAsBackgroundTask)) {
                    f.RegisterOnComplete((_) => {
                        if (_.Failed)
                            Application.Exit();
                    });

                    Application.Run();
                }
            }
        }