Example #1
0
        private void completionroutine(BCUpdate.UpdateInfo updateobject, AsyncCompletedEventArgs args)
        {
            ListViewItem upobj = lookupinfo[updateobject];
            Debug.Print("Completed download of " + updateobject.DlName);
            if (args.Error != null)
                ((DrawItemData)updateobject.Tag).DownloadError = args.Error;

            {
                completeddownloads.Add(updateobject);
            }
            alldownloads--;
            upobj.Checked = false;

            if (alldownloads == 0)
            {
                Debug.Print("All Downloads Finished.");

                InstallDownloaded_Thread();

            }
        }
Example #2
0
        private void progressroutine(BCUpdate.UpdateInfo updateobject, DownloadProgressChangedEventArgs args)
        {
            ListViewItem upobj = lookupinfo[updateobject];

            updateprogressforitem(upobj, args);
        }
Example #3
0
        private void frmUpdates_Load(object sender, EventArgs e)
        {
            //load all updates.
            tryagain:
            updateobj = new BCUpdate();
            lvwUpdates.Items.Clear();
            lvwUpdates.Columns.Clear();
            lvwUpdates.Columns.Add("NAME", "Name");
            lvwUpdates.Columns.Add("VERSION", "Version");
            lvwUpdates.Columns.Add("PROGRESS", "Download Progress",256);
            lookupinfo.Clear();
            try
            {
                foreach (BCUpdate.UpdateInfo loopupdate in updateobj.LoadedUpdates)
                {
                    loopupdate.Tag = new DrawItemData("", null);
                    string[] createdstrings = new string[] { loopupdate.DlName, loopupdate.UpdateVersion, "0" };

                    ListViewItem newitem = new ListViewItem(createdstrings);

                    newitem.Tag = loopupdate;

                    lookupinfo.Add(loopupdate, newitem);
                    lvwUpdates.Items.Add(newitem);
                }
            }
            catch(Exception except)
            {
                switch (MessageBox.Show("The Following Exception occured trying to retrieve update information:\n" + except.Message, "Unexpected Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error))
                {
                    case DialogResult.Retry:
                        goto tryagain;
                        break;
                    case DialogResult.Cancel:
                        Close();
                        break;

                }

            }
        }