Пример #1
0
        private void Preload_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            ProcessProgressChanged.Invoke(this, new EventValueArgs <int>(100));
            ProcessFinished.Invoke(this, null);
            if (e.Error != null)
            {
                ProcessProgressChanged.Invoke(this, new EventValueArgs <int>(0));
                UpdateProcessMessage(ModLoaderText.Process_Error + " " + e.Error.Message);
            }
            else if (!e.Cancelled)
            {
                UpdateProcessMessage("Preload complete!");
                GamePreloaded = true;
                ModMenuUpdated.Invoke(this, new EventValueArgs <bool>(false));
            }
            else
            {
                ProcessProgressChanged.Invoke(this, new EventValueArgs <int>(0));
                UpdateProcessMessage(ModLoaderText.Process_Cancelled);
            }

            InteractionEnable.Invoke(this, null);

            BackgroundWorker a = sender as BackgroundWorker;

            a.DoWork             -= Preload_DoWork;
            a.RunWorkerCompleted -= Preload_RunWorkerCompleted;
            a.ProgressChanged    -= Preload_ProgressChanged;
        }
Пример #2
0
 public void UpdateModMenuChangedState(bool change)
 {
     ModMenuUpdated.Invoke(this, new EventValueArgs <bool>(change));
 }