예제 #1
0
        static int Main(string[] arguments)
        {
            // set thread name for debugging
            Thread.CurrentThread.Name = "Program main thread";

            //Application.ThreadException += Application_ThreadException;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var appContext = new MyApplicationContext();

            Application.Run(appContext);
            var exitCode = appContext.ExitCode;

            appContext.Dispose();

            BasicGoogleTelemetry.SendScreenHit("ChannelList_Main: End");
            BasicGoogleTelemetry.ManageSession(true);
            BasicGoogleTelemetry.EnsureHitsSents();

            // Ensure all background threads end right now (like updating the EPG data with EpgDownloader)
            // TODO: Don't to this
            Thread.Sleep(1000);
            Environment.Exit(exitCode);

            return(exitCode);
        } // Main
예제 #2
0
        static int Main(string[] arguments)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ProcessArguments(arguments);

            if (!RunFirewallConfiguration)
            {
                var result = LaunchWizard();
                BasicGoogleTelemetry.EnsureHitsSents();

                return(result);
            }
            else
            {
                using (var dlg = new FirewallForm())
                {
                    dlg.ShowDialog();
                    return((dlg.DialogResult == DialogResult.OK) ? 0 : (dlg.DialogResult == DialogResult.Cancel) ? 1 : -1);
                } // using dlg
            }     // if-else
        }         // Main