Example #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     abftag.GetLog(true);
     abftag.WriteTags();
     lblStatus.Text = "ABF file saved with new tags!";
     formConsole.TextAdd(abftag.GetLog(true));
 }
Example #2
0
        private void LoadABF(string abfFilePath)
        {
            if (System.IO.File.Exists(abfFilePath))
            {
                btnLaunch.Enabled   = true;
                lblAbfFileName.Text = System.IO.Path.GetFileName(abfFilePath);
                btnTagAdd.Enabled   = true;
            }
            else
            {
                lblAbfFileName.Text = "";
                btnLaunch.Enabled   = false;
                cbTags.Enabled      = false;
                cbTags.Items.Clear();
                nudMin.Enabled    = false;
                nudMin.Value      = 0;
                nudSec.Enabled    = false;
                nudSec.Value      = 0;
                nudSweep.Enabled  = false;
                nudSweep.Value    = 0;
                nudTagTime.Value  = 0;
                tbComment.Enabled = false;
                tbComment.Text    = "";
                btnTagAdd.Enabled = false;
                return;
            }

            if (System.IO.File.Exists(abfFilePath + ".backup"))
            {
                BackupButtonUpdate(false);
                btnBackup.Enabled = false;
                btnSave.Enabled   = true;
            }
            else
            {
                BackupButtonUpdate(true);
                btnBackup.Enabled = true;
                btnSave.Enabled   = false;
            }

            abftag = new AbfTagEdit(abfFilePath);
            formConsole.TextClear();
            formConsole.TextAdd(abftag.GetLog(true), false);
            UpdateGui();
            string status = $"ABF file contains {abftag.tags.Count} comment tag";

            if (abftag.tags.Count != 1)
            {
                status += "s";
            }
            lblStatus.Text = status;
        }