At.FF.Krems.FullscreenBrowser.Program.Main C# (CSharp) Method

Main() private method

private Main ( string args ) : int
args string
return int
        public static int Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
            int exitcode;

            try
            {
                // Ensure the current culture passed into bindings is the OS culture.
                // By default, WPF uses en-US as the culture, regardless of the system settings.
                FrameworkElement.LanguageProperty.OverrideMetadata(
                    typeof(FrameworkElement),
                      new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
                var currentDirectory = new FileInfo(typeof(Program).Assembly.Location).DirectoryName;
                if (currentDirectory != null)
                {
                    Environment.CurrentDirectory = currentDirectory;
                }

                // Register and initialize
                Bootstrapper.Initialize(new StructureMapRegistry());

                // Run
                exitcode = Bootstrapper.GetInstance<App>().Run();
            }
            catch (Exception exception)
            {
                Logger.Error(exception);
                Logger.Debug(Bootstrapper.WhatDoIHave());
                exitcode = -1;
            }

            var log = Bootstrapper.TryGetInstance<IProcessStateLogging>();
            log?.LogProcessExited();

            return exitcode;
        }