Esempio n. 1
0
        public static void Main()
        {
            // Set the image file's build action to "Resource" and "Never copy" for this to work.
            if (!Debugger.IsAttached)
            {
                App.SplashScreen = new SplashScreen("Images/TxFlag_256.png");
                App.SplashScreen.Show(false, true);
            }

            // Set up FieldLog
            FL.AcceptLogFileBasePath();
            FL.RegisterPresentationTracing();
            TaskHelper.UnhandledTaskException = ex => FL.Critical(ex, "TaskHelper.UnhandledTaskException", true);

            // Keep the setup away
            GlobalMutex.Create("Unclassified.TxEditor");

            App.InitializeSettings();

            // Make sure the settings are properly saved in the end
            AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;

            // Setup logging
            //Tx.LogFileName = "tx.log";
            //Tx.LogFileName = "";
            //Environment.SetEnvironmentVariable("TX_LOG_UNUSED", "1", EnvironmentVariableTarget.User);
            //Environment.SetEnvironmentVariable("TX_LOG_UNUSED", null, EnvironmentVariableTarget.User);

            InitializeLocalisation();

            App app = new App();

            app.InitializeComponent();
            app.Run();
        }
Esempio n. 2
0
        public static int Main(string[] args)
        {
            if (args.Length > 0 && args[0] == "/exit")
            {
                return(CloseRunningInstance().GetAwaiter().GetResult());
            }

            App.InitializeSettings();

            // Make sure the settings are properly saved in the end
            AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;

            // Keep the setup away
            GlobalMutex.Create("Unclassified.MiniWebCompiler");
            if (!GlobalMutex.Instance.TryWait(0))
            {
                MessageBox.Show("Another instance is already running.", App.Name, MessageBoxButton.OK, MessageBoxImage.Information);
                Environment.Exit(1);
            }

            try
            {
                var app = new App();
                app.InitializeComponent();
                app.Run();
                return(0);
            }
            catch (Exception ex)
            {
                MessageBox.Show("An unexpected error has occurred.\n" + ex.ToString(), "Mini Web Compiler Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return(1);
            }
        }
Esempio n. 3
0
        static void Main()
        {
            // Set up FieldLog
            FL.AcceptLogFileBasePath();

            // Keep the setup away
            GlobalMutex.Create("Unclassified.EasyPdfSigning");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new EasyForm());
        }
Esempio n. 4
0
        public static void Main()
        {
            App.InitializeSettings();

            // Make sure the settings are properly saved in the end
            AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;

            InitializeLocalisation();

            // Keep the setup away
            GlobalMutex.Create("Unclassified.CecilExplorer");

            App app = new App();

            app.InitializeComponent();
            app.Run();
        }
Esempio n. 5
0
        public static void Main()
        {
            // Set up FieldLog
            FL.AcceptLogFileBasePath();
            FieldLogTraceListener.Start();
            TaskHelper.UnhandledTaskException = ex => FL.Critical(ex, "TaskHelper.UnhandledTaskException", true);

            App.InitializeSettings();

            // Make sure the settings are properly saved in the end
            AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
            // Keep the setup away
            GlobalMutex.Create("Unclassified.FieldLogViewer");


            App app = new App();

            app.InitializeComponent();
            app.Run();
        }