fix / suppress all remaining errors

This commit is contained in:
RandomHuman 2023-02-20 04:39:19 -07:00
parent 35337cf3ea
commit 0bd7c40af2
9 changed files with 333 additions and 9200 deletions

View file

@ -14,13 +14,13 @@ namespace XeroBrowser
{
public class DisplayHandler : IDisplayHandler
{
public FrmBrowser Frmref;
private readonly FrmBrowser _frmref;
public DisplayHandler(FrmBrowser frm)
{
Frmref = frm;
_frmref = frm;
}
public static Icon BytesToIcon(byte[] bytes)
private static Icon BytesToIcon(byte[] bytes)
{
using (MemoryStream ms = new MemoryStream(bytes))
{
@ -54,10 +54,10 @@ namespace XeroBrowser
{
WebClient wc = new WebClient();
byte[] buffer = wc.DownloadData(urls[0]);
Frmref.Icon = BytesToIcon(buffer);
Frmref.Update();
Frmref.ParentTabs.UpdateThumbnailPreviewIcon(Frmref.ParentTabs.Tabs.Single(t => t.Content == Frmref));
Frmref.ParentTabs.RedrawTabs();
_frmref.Icon = BytesToIcon(buffer);
_frmref.Update();
_frmref.ParentTabs.UpdateThumbnailPreviewIcon(_frmref.ParentTabs.Tabs.Single(t => t.Content == _frmref));
_frmref.ParentTabs.RedrawTabs();
}
@ -67,17 +67,17 @@ namespace XeroBrowser
WebClient wc = new WebClient();
Uri furi = new Uri(chromiumWebBrowser.Address);
byte[] buffer = wc.DownloadData(furi.GetLeftPart(UriPartial.Authority) +"/favicon.ico");
Frmref.Icon = BytesToIcon(buffer);
Frmref.Update();
Frmref.ParentTabs.UpdateThumbnailPreviewIcon(Frmref.ParentTabs.Tabs.Single(t => t.Content == Frmref));
Frmref.ParentTabs.RedrawTabs();
_frmref.Icon = BytesToIcon(buffer);
_frmref.Update();
_frmref.ParentTabs.UpdateThumbnailPreviewIcon(_frmref.ParentTabs.Tabs.Single(t => t.Content == _frmref));
_frmref.ParentTabs.RedrawTabs();
}
catch (Exception){
ComponentResourceManager resources = new ComponentResourceManager(typeof(FrmBrowser));
Frmref.Icon = ((Icon)(resources.GetObject("$this.Icon")));
Frmref.Update();
Frmref.ParentTabs.UpdateThumbnailPreviewIcon(Frmref.ParentTabs.Tabs.Single(t => t.Content == Frmref));
Frmref.ParentTabs.RedrawTabs();
_frmref.Icon = ((Icon)(resources.GetObject("$this.Icon")));
_frmref.Update();
_frmref.ParentTabs.UpdateThumbnailPreviewIcon(_frmref.ParentTabs.Tabs.Single(t => t.Content == _frmref));
_frmref.ParentTabs.RedrawTabs();
}
}
}