Inheritance: WindowsFormsApplicationBase
Exemplo n.º 1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        //[STAThread] //Do not use this, it breaks the ability to switch to a new desktop
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string[] arguments = Environment.GetCommandLineArgs();
            Logger.AddInformation("---------- INITIALIZING SEB - STARTING SESSION -------------");
            Logger.AddInformation(" Arguments: " + String.Join(", ", arguments));

            try
            {
                if (!InitSebSettings())
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                Logger.AddError("Unable to InitSebSettings", null, ex);
                return;
            }

            singleInstanceController = new SingleInstanceController();

            try
            {
                SEBClientInfo.SebWindowsClientForm = new SebWindowsClientForm();
                singleInstanceController.Run(arguments);
            }
            catch (Exception ex)
            {
                Logger.AddError(ex.Message, null, ex);
            }
        }
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            string[] commandLineArgs = Environment.GetCommandLineArgs();
            Logger.AddInformation("---------- INITIALIZING SEB - STARTING SESSION -------------", (object)null, (Exception)null, (string)null);
            Logger.AddInformation(" Arguments: " + string.Join(", ", commandLineArgs), (object)null, (Exception)null, (string)null);
            try
            {
                if (!SebWindowsClientMain.InitSebSettings())
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                Logger.AddError("Unable to InitSebSettings", (object)null, ex, (string)null);
                return;
            }

            /*try
             * {
             * SebWindowsClientMain.CheckDistributionIntegrity();
             * }
             * catch (Exception ex)
             * {
             * int num = (int) SEBMessageBox.Show(SEBUIStrings.integrityCheckError, SEBUIStrings.integrityCheckErrorReason, MessageBoxIcon.Hand, MessageBoxButtons.OK, false);
             * Logger.AddError(SEBUIStrings.integrityCheckError, (object) null, ex, (string) null);
             * return;
             * }
             */
            SebWindowsClientMain.singleInstanceController = new SingleInstanceController();
            try
            {
                SEBClientInfo.SebWindowsClientForm = new SebWindowsClientForm();
                SebWindowsClientMain.singleInstanceController.Run(commandLineArgs);
            }
            catch (Exception ex)
            {
                Logger.AddError(ex.Message, (object)null, ex, (string)null);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        //[STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string[] arguments = Environment.GetCommandLineArgs();
            Logger.InitLogger();
            Logger.AddInformation("---------- INITIALIZING SEB - STARTING SESSION -------------");
            Logger.AddInformation(" Arguments: " + String.Join(", ", arguments));

            try
            {
                if (!InitSebSettings())
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                Logger.AddError("Unable to InitSebSettings because of an error.", null, null);                 //Dont want to expose the error to the user since this is triggered when someone tries using wrong Config file.
                String exceptionMessage = ex.Message;
                return;
            }
            SEBProcessHandler.LogAllRunningProcesses();
            singleInstanceController = new SingleInstanceController();

            try
            {
                SEBClientInfo.SebWindowsClientForm = new SebWindowsClientForm();
                singleInstanceController.Run(arguments);
            }
            catch (Exception ex)
            {
                Logger.AddError(ex.Message, null, ex);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        //[STAThread] //Do not use this, it breaks the ability to switch to a new desktop
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string[] arguments = Environment.GetCommandLineArgs();
            Logger.AddInformation("---------- INITIALIZING SEB - STARTING SESSION -------------");
            Logger.AddInformation(" Arguments: " + String.Join(", ", arguments));
            if (arguments.Count() == 1)
            {
                try
                {
                    if (!InitSebSettings())
                        return;
                }
                catch (Exception ex)
                {
                    Logger.AddError("Unable to InitSebSettings",null, ex);
                    return;
                }
                var splashThread = new Thread(new ThreadStart(StartSplash));
                splashThread.Start();
                try
                {
                    InitSEBDesktop();
                }
                catch (Exception)
                {

                    Logger.AddInformation("Unable to InitSEBDesktop");
                }

                SEBClientInfo.SebWindowsClientForm = new SebWindowsClientForm();
                if (!SEBClientInfo.SebWindowsClientForm.OpenSEBForm())
                {
                    CloseSplash();
                    return;
                }
                CloseSplash();

                singleInstanceController = new SingleInstanceController();

                try
                {
                    singleInstanceController.Run(arguments);
                }
                catch (Exception)
                {

                }
            }
            else
            {
                try
                {
                    if (!InitSebSettings())
                        return;
                }
                catch (Exception ex)
                {
                    Logger.AddError("Unable to InitSebSettings", null, ex);
                }
                SEBClientInfo.SebWindowsClientForm = new SebWindowsClientForm();
                singleInstanceController = new SingleInstanceController();
                singleInstanceController.Run(arguments);
            }
        }
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        //[STAThread] //Do not use this, it breaks the ability to switch to a new desktop
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string[] arguments = Environment.GetCommandLineArgs();
            Logger.InitLogger();
            Logger.AddInformation("---------- INITIALIZING SEB - STARTING SESSION -------------");
            Logger.AddInformation(" Arguments: " + String.Join(", ", arguments));

            try
            {
                if (!InitSebSettings())
                    return;
            }
            catch (Exception ex)
            {
                Logger.AddError("Unable to InitSebSettings", null, ex);
                return;
            }

            singleInstanceController = new SingleInstanceController();

            try
            {
                SEBClientInfo.SebWindowsClientForm = new SebWindowsClientForm();
                singleInstanceController.Run(arguments);
            }
            catch (Exception ex)
            {
                Logger.AddError(ex.Message, null, ex);
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 //[STAThread] //Do not use this, it breaks the ability to switch to a new desktop
 static void Main()
 {
     Instance = new SingleInstanceController<SebWindowsClientForm>(CreateMainForm, (mainForm, args) =>
     {
         if(CheckLoadSettingsCommandLine(args))
         {
             SebWindowsClientForm.SEBToForeground();
             OpenExam(false, true);
         }
         else
         {
             Logger.AddError("SingleInstanceController command line load failed", null, null);
         }
     });
     Instance.Run();
 }