Ejemplo n.º 1
0
        /// <summary>
        /// Event handler for the KSPMAStarted event.
        /// Starts the app and mod update checks.
        /// </summary>
        protected static void KSPMAStarted(object sender)
        {
            EventDistributor.InvokeAsyncTaskStarted(Instance);
            ModSelectionController.View.ShowBusy = true;

            AsyncTask <bool> .DoWork(() =>
            {
                // Auto KSP MA update check.
                OptionsController.Check4AppUpdates();

                // Auto mod update check.
                OptionsController.Check4ModUpdates(true);

                return(true);
            },
                                     (result, ex) =>
            {
                EventDistributor.InvokeAsyncTaskDone(Instance);
                ModSelectionController.View.ShowBusy = false;
                if (ex != null)
                {
                    Messenger.AddError(string.Format("Error during startup update checks! {0}", ex.Message), ex);
                }
            }
                                     );
        }