コード例 #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);
                }
            }
                                     );
        }
コード例 #2
0
 /// <summary>
 /// Handles the Click event of the btnCheckModUpdates.
 /// </summary>
 private void btnCheckModUpdates_Click(object sender, EventArgs e)
 {
     OptionsController.Check4ModUpdates(ModSelectionController.Mods.ToArray());
 }