/////////////////////////////////////////////////////////// private void Form1_Load(object sender, EventArgs e) { this.MaximizeBox = false; textBox2.Visible = false; //<-Comment these out textBox3.Visible = false; //<-if debugging label4.Visible = false; //<-is needed ToggleForms(6, 0); checkphonelbl.Text = string.Empty; proglbl.Text = string.Empty; if (File.Exists(Directory.GetCurrentDirectory() + "/version")) { File.Delete(Directory.GetCurrentDirectory() + "/version"); } using (StreamWriter swv = new StreamWriter(Directory.GetCurrentDirectory() + "/version")) { swv.WriteLine(GlobalVar.currentversion); } if (!Directory.Exists("sdk/platform-tools/")) { ToggleForms(4, 0); DialogResult result = MessageBox.Show("Necessary tools will have to be downloaded to change your Galaxy S8's navbar color. Tools will be downloaded if you press Yes.", "Missing necessary tools", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { string dllink = "https://dl.google.com/android/repository/platform-tools-latest-windows.zip"; WebClient wc = new WebClient(); wc.DownloadFileAsync(new Uri(dllink), Path.GetTempPath() + "/tools.zip"); proglbl.Text = "Downloading necessary tools. Download has not started yet."; wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(wc_DownloadProgressChanged); wc.DownloadFileCompleted += new AsyncCompletedEventHandler(wc_DownloadFileCompleted); } else { this.Close(); } } else if (Directory.Exists("sdk/platform-tools/")) { GenerateBats(); ToggleForms(4, 1); ToggleForms(7, 1); mngServer(true); CheckUpdateAvailable(); } this.FormClosing += Form1_FormClosing; const string REGISTRY_KEY = @"HKEY_CURRENT_USER\Software\S8NavCC"; const string REGISTY_VALUE = "FirstRun"; if (Convert.ToInt32(Microsoft.Win32.Registry.GetValue(REGISTRY_KEY, REGISTY_VALUE, 0)) == 0) { UpdateNotes un = new UpdateNotes(); un.Show(); Microsoft.Win32.Registry.SetValue(REGISTRY_KEY, REGISTY_VALUE, 1, Microsoft.Win32.RegistryValueKind.DWord); } }
private void upnotesbtn_Click(object sender, EventArgs e) { this.Enabled = false; UpdateNotes un = new UpdateNotes(); un.Show(); this.FormClosed += (s, args) => un.Close(); un.FormClosed += (s, args) => this.Enabled = true; }