fix every last warning in every last file (non-html at least)

This commit is contained in:
RandomHuman 2023-02-20 03:59:04 -07:00
parent dc5d26d13e
commit f7eef416d9
14 changed files with 154 additions and 189 deletions

View file

@ -7,10 +7,9 @@ using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
using CefSharp;
using WebBrowser;
using Timer = System.Threading.Timer;
namespace DiamondCreeperBrowser
namespace XeroBrowser
{
public class DownloadHandler : IDownloadHandler
{
@ -18,30 +17,30 @@ namespace DiamondCreeperBrowser
public event EventHandler<DownloadItem> OnDownloadUpdatedFired;
public frmBrowser frmref;
public DownloadHandler(frmBrowser frm)
public FrmBrowser Frmref;
public DownloadHandler(FrmBrowser frm)
{
frmref = frm;
Frmref = frm;
}
public DownloadProgress downloadProgress = new DownloadProgress();
public DownloadItem downloadItem;
public DownloadProgress DownloadProgress = new DownloadProgress();
public DownloadItem DownloadItem;
public void OnBeforeDownload(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IBeforeDownloadCallback callback)
{
OnBeforeDownloadFired?.Invoke(this, downloadItem);
this.downloadItem = downloadItem;
this.DownloadItem = downloadItem;
try
{
frmref.Invoke((Action)delegate
Frmref.Invoke((Action)delegate
{
downloadProgress.Show();
downloadProgress.FormClosing += DownloadProgress_FormClosing;
DownloadProgress.Show();
DownloadProgress.FormClosing += DownloadProgress_FormClosing;
});
}
catch (ObjectDisposedException){};
catch (ObjectDisposedException){}
if (!callback.IsDisposed)
{
@ -54,10 +53,10 @@ namespace DiamondCreeperBrowser
private void DownloadProgress_FormClosing(object sender, FormClosingEventArgs e)
{
downloadItem.IsCancelled = true;
DownloadItem.IsCancelled = true;
}
public Timer fivesecondtimer;
public Timer Fivesecondtimer;
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback)
{
OnDownloadUpdatedFired?.Invoke(this, downloadItem);
@ -65,29 +64,28 @@ namespace DiamondCreeperBrowser
if (downloadItem.IsComplete)
{
fivesecondtimer = new Timer(tcallback, null, 1000 * 5, 1000 * 5);
Fivesecondtimer = new Timer(tcallback, null, 1000 * 5, 1000 * 5);
}
frmref.Invoke((Action)delegate {
downloadProgress.ProgressBar1.Value = downloadItem.PercentComplete;
downloadProgress.ProgressPrecentage.Text = downloadItem.PercentComplete + "% " + (downloadItem.ReceivedBytes / 0x100000) + "MB / " + (downloadItem.TotalBytes / 0x100000) + "MB";
downloadProgress.ProgressFileName.Text = Path.GetFileName(downloadItem.FullPath);
downloadProgress.Update();
try { } catch (InvalidAsynchronousStateException){};
Frmref.Invoke((Action)delegate {
DownloadProgress.ProgressBar1.Value = downloadItem.PercentComplete;
DownloadProgress.ProgressPrecentage.Text = downloadItem.PercentComplete + @"% " + (downloadItem.ReceivedBytes / 0x100000) + @"MB / " + (downloadItem.TotalBytes / 0x100000) + @"MB";
DownloadProgress.ProgressFileName.Text = Path.GetFileName(downloadItem.FullPath);
DownloadProgress.Update();
try { } catch (InvalidAsynchronousStateException){}
});
}
private void tcallback(object state)
{
try {
frmref.Invoke((Action)delegate
Frmref.Invoke((Action)delegate
{
downloadProgress.Close();
DownloadProgress.Close();
});
}
catch (InvalidOperationException){};
catch (InvalidOperationException){}
}
}
}