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

            if (IsAlreadyRunning())
            {
                MessageBox.Show("An instance of " + Application.ProductName + " is already running.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            // Load all the sessions instantly, and start some.
            Core c = Core.Instance();
            foreach (Session s in c.Sessions)
            {
                if (s.AutoOpenTunnels)
                {
                    s.Open();
                }
            }
            AppDomain currentDomain = AppDomain.CurrentDomain;
            currentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
            TrayIcon = new TrayIcon();

            Application.Run();
            TrayIcon = null;
        }
Example #2
0
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (IsAlreadyRunning())
            {
                MessageBox.Show($"An instance of {Application.ProductName} is already running.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            TrayIcon = new TrayIcon();

            Application.Run();
            TrayIcon = null;
        }