/// <summary> /// Initialize the browser /// </summary> public void CreateBrowserHandle(string URL, MaterialTabPage tabPage) { //Initializing the new browser browser = new ChromiumWebBrowser(URL); //Setting all of the events of the browser browser.TitleChanged += browser_TitleChanged; browser.AddressChanged += browser_AddressChanged; browser.LoadingStateChanged += browser_LoadingStateChanged; browser.FrameLoadEnd += (sender, args) => { browser.InvokeOnUiThreadIfRequired(() => { //Runs the first load event args if (!isFirstLoad) { isFirstLoad = true; FirstLoad?.Invoke(this, new EventArgs()); } }); }; //Setting the main tab page mainTabPage = tabPage; mainTabPage.BackColor = Color.Black; //Setting the browser objects browser.DownloadHandler = new DownloadHandler(); browser.DisplayHandler = new DisplayHandler(this); browser.LifeSpanHandler = new LifespanHandler(tabPage); browser.MenuHandler = new ContextMenuHandler(tabPage); }
private void InitialLoad() { if (FirstLoad.IsBusy == false) { FirstLoad.RunWorkerAsync(); } Loader.INFO = "Welcome Initilizing"; Loader.INFO = "Reading Archive.Dat"; if (File.Exists(Application.StartupPath + @"/archive.dat")) { Archive1Worker.RunWorkerAsync(); } string[] lines = System.IO.File.ReadAllLines(Application.StartupPath + "\\out.txt"); string cleanline = ""; if (File.Exists("out.txt")) { //do the directory creation first else there will be ERRORS !! if (FirstLoad.IsBusy == false) { FirstLoad.RunWorkerAsync(); } Loader.INFO = "Loading dev_hhd0 directories"; foreach (string line in lines) { if (line.Contains("Backup id :")) { Loader.INFO = "Loading Backup ID"; cleanline = line.Substring(line.IndexOf(':')); if (cleanline.Contains(":")) { cleanline = cleanline.Replace(":", ""); } lblBackupID.Text = cleanline.ToUpper(); } if (line.Contains("Total files :")) { Loader.INFO = "Counting Files "; cleanline = line.Substring(line.IndexOf(':')); if (cleanline.Contains(":")) { cleanline = cleanline.Replace(":", ""); } lblTotalFiles.Text = cleanline.ToUpper(); } if (line.Contains("Total directories :")) { Loader.INFO = "Counting Files "; cleanline = line.Substring(line.IndexOf(':')); if (cleanline.Contains(":")) { cleanline = cleanline.Replace(":", ""); } label3.Text = "Total directories :" + cleanline.ToUpper(); } if (line.Contains("Total archive size :")) { Loader.INFO = "Counting Files "; cleanline = line.Substring(line.IndexOf(':')); if (cleanline.Contains(":")) { cleanline = cleanline.Replace(":", ""); } label4.Text = "Total archive size :" + cleanline.ToUpper(); } if (line.Contains("Your Open PSID :")) { Loader.INFO = "Counting Files "; cleanline = line.Substring(line.IndexOf(':')); if (cleanline.Contains(":")) { cleanline = "Your Open PSID :" + cleanline.Replace(":", ""); } label5.Text = cleanline.ToUpper(); } // if (line.Contains("Total archive size :")) { cleanline = line.Substring(line.IndexOf(':')); if (cleanline.Contains(":")) { cleanline = cleanline.Replace(":", ""); } label4.Text = "Total archive size : " + cleanline; } if (line.Contains("Total filesize of the copy-protected content :")) { cleanline = line.Substring(line.IndexOf(':')); if (cleanline.Contains(":")) { cleanline = cleanline.Replace(":", ""); } label6.Text = "Total filesize of the copy-protected content :" + cleanline; } if (File.Exists(Application.StartupPath + "\\idps.bin")) { byte[] idps = System.IO.File.ReadAllBytes(Application.StartupPath + "\\idps.bin"); label7.Text = "Your IDPS : " + idps; } else if (!File.Exists(Application.StartupPath + "\\idps.bin")) { label7.Text = "Your IDPS : Is Not Found"; } if (line.Contains("drwx")) { if (line.Contains("/dev_hdd0/")) { string appstart = Application.StartupPath + @"/PS3/"; cleanline = line.Substring(line.IndexOf('/')); try { if (!Directory.Exists(appstart + cleanline)) { Directory.CreateDirectory(appstart + cleanline); } } catch (Exception e) { MessageBox.Show(e.Message); } } } } } //do file creation Loader.INFO = ("Loading dev_hdd0 /Files"); System.Threading.Thread.Sleep(1000); foreach (string line in lines) { if (line.Contains("Total archive size :")) { cleanline = line.Substring(line.IndexOf(':')); if (cleanline.Contains(":")) { cleanline = cleanline.Replace(":", ""); } label4.Text = "Total archive size : " + cleanline; } if (line.Contains("-rw") && !line.Contains("drwx")) { if (line.Contains("/dev_hdd0/")) { string appstart = Application.StartupPath + @"/PS3/"; cleanline = line.Substring(line.IndexOf('/')); try { if (!File.Exists(appstart + cleanline)) { File.Create(appstart + cleanline); } } catch (Exception e) { MessageBox.Show(e.Message); } } } } Loader.INFO = ("Loading Items"); if (Directory.Exists(Application.StartupPath + @"/PS3")) { try { ListDirectory(treeView, Application.StartupPath + @"/PS3"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } FirstLoad.CancelAsync(); FirstLoad.Dispose(); }
protected virtual void OnFirstLoad() { FirstLoad?.Invoke(this, new EventArgs()); }