private void guMaskOK_Click(object sender, EventArgs e) { MessageBox.Show("If you have categorized tags earlier, remember\r\n" + "to click \"Load tag cat.\" once the cat window\r\n" + "has finished loading.", "Tip"); iTagCollection tc = new iTagCollection(); gugMask.Enabled = false; string mask = guMask.Text; string rpl1 = guReplace.Text; string rpl2 = guReplace2.Text; string splitBy = guSplit.Text; string[] files; if (guRoot.Text != "list.txt") { files = cb.getFiles(guRoot.Text); } else { files = System.IO.File.ReadAllText("list.txt", Encoding.UTF8).Replace("\r", ""). Trim('\n').Split('\n'); } string[] tagFn = files; for (int a = 0; a < tagFn.Length; a++) { int ofs = tagFn[a].LastIndexOf("\\"); tagFn[a] = tagFn[a].Substring(ofs + 1); } proa.Maximum = tagFn.Length; inf = new imInfo[files.Length]; for (int a = 0; a < tagFn.Length; a++) { if (a % 250 == 0) { proa.Value = a; prob.Text = "Parsing file " + (a + 1) + " of " + tagFn.Length; Application.DoEvents(); } iTag[] it = getTags(tagFn[a], mask, rpl1, rpl2, splitBy).Get(); tc.Add(it); inf[a] = new imInfo(); inf[a].path = files[a]; inf[a].tags = new iTag[it.Length]; for (int b = 0; b < it.Length; b++) { inf[a].tags[b] = new iTag( it[b].tag, iTag.tUnk, 0); } } int proas = proa.Maximum / 3; prob.Text = "Reading categories"; proa.Value = proas * 1; Application.DoEvents(); tc.LoadAppend(); //Read db prob.Text = "Saving new tags.db"; proa.Value = proas * 2; Application.DoEvents(); tc.Save(); //Store tags.db prob.Text = "Preparing GUI"; proa.Value = proa.Maximum; Application.DoEvents(); doCat(tc, false); }
private void gSave_Click(object sender, EventArgs e) { stat("Saving ..."); this.Enabled = false; tc.Save(); //Save tags database stat("Ready."); this.Enabled = true; }