Ejemplo n.º 1
0
 public void SetUp()
 {
     try
     {
         File.Delete(ApplicationDataXmlFile);
     } catch { }
     HostManager.InitializeCore();
 }
Ejemplo n.º 2
0
 public void SetUp()
 {
     try
     {
         File.Delete(DbConstants.DatabaseFile);
     }
     catch { }
     HostManager.InitializeCore();
 }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            System.Threading.Thread.CurrentThread.Name = "Main";
            var parser = new CommandlineParser(args);

            HostManager.InitializeCore();
#if !DEBUG
            try
            {
#endif
            if (parser.HasDefinitions)
            {
                ConfigureFromArgs(parser);
                HostManager.StartProcess(parser.IsDefined(CommandlineOption.ApplicationDataFile)
                                   ? parser.GetOption(CommandlineOption.ApplicationDataFile)
                                   : HostCore.Configuration.Application.DefaultApplicationDataFile);
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new FrmManager());
            }
#if !DEBUG
        }

        catch (Exception ex)
        {
            // ToDo: Refactor following code to use WinForm in stead of console window
            CoreBus.Log.Critical("A fatal exception occured.", ex);
            ProcessHelper.SetWindowState(WindowShowStyle.ShowNormal);
            Console.WriteLine("\r\n\r\n\r\n\r\n\r\n\r\n");
            Console.WriteLine("############################################################\r\n");
            Console.WriteLine(" A fatal exception occured, see below for more information.\r\n");
            Console.WriteLine("############################################################\r\n");
            Console.WriteLine(ex.GetType());
            Console.WriteLine(" -> " + ex.Message);
        }
#endif
            Console.WriteLine("\r\n\r\nPress any key to exit.\r\n");
            Console.ReadLine();
        }