Beispiel #1
0
        /// <summary>
        /// Initializes the application, runs it, and manages
        /// the resources.
        /// </summary>
        public static void Run()
        {
            // Initialize the logging system.
            LogHelper.InitializeLoggingSystem();

            // Initialize settings.
            InitializeUserSettings();

            // Initialize the configuration system.
            ConfigurationHelper.InitializeConfiguration();

            // Create the application.
            App app = new App();

            // Load the navigation actor.
            NavigationActor.Instance = new NavigationActor();

            // Start loading user resources.
            RadicalStore.Instance.InitializeAsync();
            SrsLevelStore.Instance.InitializeAsync();

            // Load the autostart configuration.
            AutostartBusiness.Instance.Load();

            // Start the version business.
            VersionBusiness.Initialize();

            // Start the SRS business.
            SrsBusiness.Initialize();

            using (NamedPipeHandler pipeHandler = new NamedPipeHandler(InstanceHelper.InterfaceApplicationGuid))
            {
                // Listen for incoming pipe messages, to allow other processes to
                // communicate with this one.
                PipeActor.Initialize(pipeHandler);
                pipeHandler.StartListening();

                // Run the app.
                app.InitializeComponent();
                AppDomain.CurrentDomain.UnhandledException += OnAppDomainUnhandledException;
                app.DispatcherUnhandledException           += OnUnhandledException;
                TaskScheduler.UnobservedTaskException      += OnUnobservedTaskException;
                app.Run();

                // The execution blocks here until the application exits.
            }
        }
        /// <summary>
        /// Initializes the application, runs it, and manages
        /// the resources.
        /// </summary>
        public static void Run()
        {
            // Initialize the logging system.
            LogHelper.InitializeLoggingSystem();

            // Initialize settings.
            InitializeUserSettings();

            // Initialize the configuration system.
            ConfigurationHelper.InitializeConfiguration();

            // Load the navigation actor.
            NavigationActor.Instance = new NavigationActor();

            // Start loading user resources.
            RadicalStore.Instance.InitializeAsync();
            SrsLevelStore.Instance.InitializeAsync();

            // Load the autostart configuration.
            AutostartBusiness.Instance.Load();

            // Start the version business.
            VersionBusiness.Initialize();

            AppDomain.CurrentDomain.UnhandledException += OnAppDomainUnhandledException;
            //app.DispatcherUnhandledException += OnUnhandledException;
            TaskScheduler.UnobservedTaskException += OnUnobservedTaskException;

            using (NamedPipeHandler pipeHandler = new NamedPipeHandler(InstanceHelper.InterfaceApplicationGuid))
            {
                // Listen for incoming pipe messages, to allow other processes to
                // communicate with this one.
                PipeActor.Initialize(pipeHandler);
                pipeHandler.StartListening();
                var app = BuildAvaloniaApp().AfterSetup((a) =>
                {
                    // Start the SRS business.
                    SrsBusiness.Initialize();
                }).StartWithClassicDesktopLifetime(new string[] { });
            }
        }