Example #1
0
        private void MaterialButtonClose_Click(object sender, EventArgs e)
        {
            if (oConfigMng.Config.Autosavelogs == "true")
            {
                cAppend("EXIT: Saving Firmware logs...");
                try
                {
                    string filePath = @"C:\adb\.settings\Logs\FirmwareLogs.txt";
                    cAppend("EXIT: Saving Firmware logs... {OK}");
                    console.SaveFile(filePath, RichTextBoxStreamType.PlainText);
                }
                catch (Exception ex)
                {
                    Logs.DebugErrorLogs(ex);
                    cAppend("EXIT: Saving Firmware logs... {ERROR}");
                    Dialogs.ErrorDialog("An error has occured while attempting to save the output...", ex.ToString());
                }
            }
            var download = new DownloadUI();

            if (download.webClient != null)
            {
                download.webClient.CancelAsync();
                download.Dispose();
                this.Dispose();
            }
            else
            {
                download.Dispose();
                this.Dispose();
            }
        }