Esempio n. 1
0
        static void Main()
        {
            // Hook up so that we can fetch unhandled events.
             AppDomain currentDomain = AppDomain.CurrentDomain;
             currentDomain.UnhandledException += new UnhandledExceptionEventHandler(currentDomain_UnhandledException);
             System.Windows.Forms.Application.ThreadException += new ThreadExceptionEventHandler(currentDomain_ThreadException);

             // What does this actually do...?
             System.Windows.Forms.Application.EnableVisualStyles();
             System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

             formConnect connectDlg = new formConnect();
             if (!connectDlg.AutoConnect())
             {
            if (connectDlg.ShowDialog() != DialogResult.OK)
            {
               // We failed to connect. Exit app again.
               return;
            }
             }

             hMailServer.Application application = connectDlg.Application;
             string serverHost = connectDlg.Server;

             System.Windows.Forms.Application.Run(new formMain(application, serverHost));

             if (application != null)
            Marshal.ReleaseComObject(application);
        }
Esempio n. 2
0
        static void Main()
        {
            // Hook up so that we can fetch unhandled events.
            AppDomain currentDomain = AppDomain.CurrentDomain;

            currentDomain.UnhandledException += new UnhandledExceptionEventHandler(currentDomain_UnhandledException);
            System.Windows.Forms.Application.ThreadException += new ThreadExceptionEventHandler(currentDomain_ThreadException);

            // What does this actually do...?
            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

            formConnect connectDlg = new formConnect();

            if (!connectDlg.AutoConnect())
            {
                if (connectDlg.ShowDialog() != DialogResult.OK)
                {
                    // We failed to connect. Exit app again.
                    return;
                }
            }

            hMailServer.Application application = connectDlg.Application;
            string serverHost = connectDlg.Server;

            System.Windows.Forms.Application.Run(new formMain(application, serverHost));

            if (application != null)
            {
                Marshal.ReleaseComObject(application);
            }
        }
Esempio n. 3
0
        private bool Connect()
        {
            // Should we save the currently viewed?
            if (!AskSaveChanges())
            {
                treeNodes.SelectedNode = currentlySelectedNode;
                return(false);
            }

            // Connect
            formConnect connectDlg = new formConnect();

            if (connectDlg.ShowDialog() != DialogResult.OK)
            {
                return(false);
            }

            application = connectDlg.Application;
            _serverHost = connectDlg.Server;

            Initialize();

            return(true);
        }
Esempio n. 4
0
        private bool Connect()
        {
            // Should we save the currently viewed?
               if (!AskSaveChanges())
               {
              treeNodes.SelectedNode = currentlySelectedNode;
              return false;
               }

            // Connect
            formConnect connectDlg = new formConnect();

            if (connectDlg.ShowDialog() != DialogResult.OK)
                return false;

            application = connectDlg.Application;
            _serverHost = connectDlg.Server;

            Initialize();

            return true;
        }