Пример #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            try
            {
                var mainForm = new Form();
                mainForm.Load += (object sender, EventArgs e) =>
                {
                    mainForm.Visible = false;
                    mainForm.ShowInTaskbar = false;
                };

                mainForm.FormClosed += (object sender, FormClosedEventArgs e) =>
                {
                    Application.Exit();
                };

                using (var applicationContext = new SquidApplicationContext(mainForm))
                {
                    Application.Run(applicationContext);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    ex.Message,
                    "Squid Terminated Unexpectedly",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }
Пример #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            try
            {
                var mainForm = new Form();
                mainForm.Load += (object sender, EventArgs e) =>
                {
                    mainForm.Visible       = false;
                    mainForm.ShowInTaskbar = false;
                };

                mainForm.FormClosed += (object sender, FormClosedEventArgs e) =>
                {
                    Application.Exit();
                };

                using (var applicationContext = new SquidApplicationContext(mainForm))
                {
                    Application.Run(applicationContext);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    ex.Message,
                    "Squid Terminated Unexpectedly",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }