Fix ALL Warnings

This commit is contained in:
RandomHuman 2023-02-20 03:39:55 -07:00
parent c6f787c39c
commit dc5d26d13e
17 changed files with 186 additions and 204 deletions

View file

@ -1,24 +1,12 @@
using Bunifu.Utils;
using CefSharp;
using CefSharp.WinForms;
using DiamondCreeperBrowser;
using XeroBrowser.Properties;
using EasyTabs;
using System;
using System.Collections.Generic;
using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CefSharp.DevTools.Network;
using CefSharp.DevTools.Page;
using System.Runtime.Versioning;
using System.Xml.Linq;
using System.IO;
using System.Windows.Forms;
using Bunifu.Utils;
using CefSharp;
using DiamondCreeperBrowser;
using EasyTabs;
using XeroBrowser.Properties;
namespace WebBrowser
{
@ -38,7 +26,7 @@ namespace WebBrowser
string fileUrl = fileUri.AbsoluteUri;
chromiumWebBrowser1.Load(fileUrl);
txtSearchOrUrl.Text = "";
Form.CheckForIllegalCrossThreadCalls = false;
CheckForIllegalCrossThreadCalls = false;
}
@ -71,18 +59,18 @@ namespace WebBrowser
chromiumWebBrowser1.Reload();
}
private bool isBlocked = false;
private bool isBlocked;
private void chromiumWebBrowser1_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
{
if (e.IsLoading)
{
this.loadingIndicator.Visible = true;
this.btnRefresh.Visible = false;
loadingIndicator.Visible = true;
btnRefresh.Visible = false;
}
else
{
this.loadingIndicator.Visible = false;
this.btnRefresh.Visible = true;
loadingIndicator.Visible = false;
btnRefresh.Visible = true;
}
try
@ -90,7 +78,7 @@ namespace WebBrowser
if (this == null)
return;
this.Invoke((Action)delegate
Invoke((Action)delegate
{
if (txtSearchOrUrl != null && chromiumWebBrowser1 != null)
{
@ -112,19 +100,19 @@ namespace WebBrowser
var uri = new Uri(chromiumWebBrowser1.Address);
if (uri.Scheme == "file")
{
txtSearchOrUrl.IconLeft = XeroBrowser.Properties.Resources.local;
txtSearchOrUrl.IconLeft = Resources.local;
}
else if (uri.Scheme == "https")
{
txtSearchOrUrl.IconLeft = XeroBrowser.Properties.Resources.secure;
txtSearchOrUrl.IconLeft = Resources.secure;
}
else
{
txtSearchOrUrl.IconLeft = XeroBrowser.Properties.Resources.insecure1;
txtSearchOrUrl.IconLeft = Resources.insecure1;
if (!isBlocked)
{
MessageBox.Show("Warning: This site is insecure!, Your personal information may be at risk or hackers can install malicious software on your device.", "Xero Browser", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
MessageBox.Show("Warning: This site is insecure!, Your personal information may be at risk or hackers can install malicious software on your device.", "Xero Browser", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
@ -179,7 +167,7 @@ namespace WebBrowser
{
try
{
this.Invoke((Action)delegate { this.FindForm().Text = e.Title; });
Invoke((Action)delegate { FindForm().Text = e.Title; });
}
catch (ObjectDisposedException) { }
}