Example #1
0
 private void OnCompleted(object sender, ProgressCompletedEventArgs e)
 {
     if (ProgressCompleted != null)
     {
         ProgressCompleted(sender, e);
     }
 }
Example #2
0
        private void update_ProgressCompleted(object sender, ProgressCompletedEventArgs e)
        {
            if (e.Cancelled)
                return;

            Invoke((MethodInvoker)delegate
            {
                if (e.ExceptionObject != null)
                {
                    Program.Status = UpdateStatus.Failure;
                    txtChangeLog.Text = string.Format("The following error occured while trying to get the lastest ConnectUO version information: \n {0}", ((Exception)e.ExceptionObject).Message);
                    Complete();
                    return;
                }

                pbProgress.Value = 100;
                lblStatus.Text = string.Format("Status: Extracting...");

                System.Threading.ThreadPool.QueueUserWorkItem(delegate(object o)
                {
                    _extractor = new SevenZipExtractor(_destinationFile);

                    _extractor.Extracting += new EventHandler<SevenZip.ProgressEventArgs>(extractor_Extracting);
                    _extractor.ExtractionFinished += new EventHandler(extractor_ExtractionFinished);
                    _extractor.ExtractArchive(_destinationDirectory);
                    _extractor.Dispose();
                });
            });
        }
Example #3
0
        private void OnExtractionProgressCompleted(object sender, ProgressCompletedEventArgs e)
        {
            ExtractionTask task = e.State as ExtractionTask;

            if (task != null)
            {
                string status = "Extraction Complete";

                if (e.ExceptionObject != null)
                {
                    _errorMessages.Add(string.Format("Extraction Manager reporting the following error: {0} - {1}", task.Archive,
                        ((Exception)e.ExceptionObject).Message));

                    _failedPatchFiles.Add(Path.GetFileName(task.Archive));

                    status = String.Format("Failed: {0}", ((Exception)e.ExceptionObject).Message);
                }

                Invoke((MethodInvoker)delegate()
                {
                    ListViewItem item = _extractionTable[task];
                    UpdateExtractionStatus(task, item, e.Current, e.Max, e.ProgressPercentage, status);
                });

                _extractionsComplete++;

                if (_extractionsComplete == _patches.Length)
                {
                    InitializePatchingProcess();
                }
            }
        }
Example #4
0
        private void OnPatchingProgressCompleted(object sender, ProgressCompletedEventArgs e)
        {
            PatchingTask task = e.State as PatchingTask;

            if (task != null)
            {
                string status = "Patching Complete";

                if (e.ExceptionObject != null)
                {
                    _errorMessages.Add(string.Format("Patching Manager reporting the following error: {0} - {1}", task.PatchType,
                        ((Exception)e.ExceptionObject).Message));

                    status = String.Format("Failed: {0}", ((Exception)e.ExceptionObject).Message);
                }

                Invoke((MethodInvoker)delegate()
                {
                    ListViewItem item = _patchTable[task];
                    UpdatePatchingStatus(task, item, e.Current, e.Max, e.ProgressPercentage, status);
                });

                _patchesComplete++;

                if (_patchesComplete == _patchCount)
                {
                    Complete();
                }
            }
        }
Example #5
0
        private void OnDownloadStateProgressCompleted(object sender, ProgressCompletedEventArgs e)
        {
            DownloadTask task = e.State as DownloadTask;

            if (task != null)
            {
                string status = "Download Complete";
                bool extract = true;

                if(e.ExceptionObject != null)
                {
                    _errorMessages.Add(string.Format("Download Manager reporting the following error: {0} - {1}", task.Url,
                        ((Exception)e.ExceptionObject).Message));

                    _failedPatchFiles.Add(Path.GetFileName(task.Url));

                    extract = false;
                    status = String.Format("Failed: {0}", ((Exception)e.ExceptionObject).Message);
                }

                Invoke((MethodInvoker)delegate()
                {
                    ListViewItem item = _downloadTable[task];
                    UpdateDownloadStatus(task, item, e.Current, e.Max, e.ProgressPercentage, status);
                });

                if (extract)
                {
                    InitializeExtractionTask(task);
                }
            }
        }