public void filter_cleaners(TreeView treeView1, List <string> searchstring, TextBox textBox1, PictureBox pictureBox1) { //blocks repainting tree till all objects loaded treeView1.BeginUpdate(); treeView1.Nodes.Clear(); if (textBox1.Text != string.Empty) { pictureBox1.Image = global::pcsm.Properties.Resources.x; for (int x = 0; x < DiskCleaner._fieldsTreeCache.Nodes.Count; x++) { Match m1 = Regex.Match(DiskCleaner._fieldsTreeCache.Nodes[x].Text, textBox1.Text, RegexOptions.IgnoreCase); if (m1.Success) { for (int y = 0; y < DiskCleaner._fieldsTreeCache.Nodes[x].Nodes.Count; y++) { searchstring.Add(DiskCleaner._fieldsTreeCache.Nodes[x].Nodes[y].Tag.ToString()); } } else { for (int y = 0; y < DiskCleaner._fieldsTreeCache.Nodes[x].Nodes.Count; y++) { Match m = Regex.Match(DiskCleaner._fieldsTreeCache.Nodes[x].Nodes[y].Tag.ToString(), textBox1.Text, RegexOptions.IgnoreCase); Match m2 = Regex.Match(DiskCleaner._fieldsTreeCache.Nodes[x].Nodes[y].Text, textBox1.Text, RegexOptions.IgnoreCase); if (m.Success) { searchstring.Add(DiskCleaner._fieldsTreeCache.Nodes[x].Nodes[y].Tag.ToString()); } else if (m2.Success) { searchstring.Add(DiskCleaner._fieldsTreeCache.Nodes[x].Nodes[y].Tag.ToString()); } else { } } } } DiskCleaner.search_cleaners(treeView1, "blb\\Bleachbit.ini", searchstring); searchstring.Clear(); treeView1.ExpandAll(); } else { pictureBox1.Image = global::pcsm.Properties.Resources.q; foreach (TreeNode _node in DiskCleaner._fieldsTreeCache.Nodes) { treeView1.Nodes.Add((TreeNode)_node.Clone()); } DiskCleaner.selectionload(treeView1, "blb\\Bleachbit.ini"); } //enables redrawing tree after all objects have been added treeView1.EndUpdate(); }
private void button4_Click(object sender, EventArgs e) { if (this.textBox1.Text != string.Empty) { Global.cleanertext = this.textBox1.Text; } DiskCleaner.save_Cleaners(treeView1, "blb\\Bleachbit.ini"); this.Close(); }
public void refresh_cleaners(TreeView treeView1, string settingsfile) { for (int i = 0; i < treeView1.Nodes.Count; i++) { treeView1.Nodes[i].Checked = DiskCleaner.secselection(treeView1.Nodes[i].Name, settingsfile); for (int j = 0; j < treeView1.Nodes[i].Nodes.Count; j++) { treeView1.Nodes[i].Nodes[j].Checked = DiskCleaner.selection(treeView1.Nodes[i].Nodes[j].Tag.ToString(), settingsfile); } } }
private void treeView1_MouseLeave(object sender, EventArgs e) { DiskCleaner.save_Cleaners(treeView1, "blb\\Bleachbit.ini"); System.Threading.Thread.Sleep(250); DiskCleaner._fieldsTreeCache.Nodes.Clear(); if (DiskCleaner._fieldsTreeCache.Nodes.Count == 0) { foreach (TreeNode node in treeView1.Nodes) { DiskCleaner._fieldsTreeCache.Nodes.Add((TreeNode)node.Clone()); } } }
private void Form1_Load(object sender, EventArgs e) { DiskCleaner.selectionload(treeView1, "blb\\Bleachbit.ini"); DiskCleaner._fieldsTreeCache.Nodes.Clear(); foreach (TreeNode node in treeView1.Nodes) { DiskCleaner._fieldsTreeCache.Nodes.Add((TreeNode)node.Clone()); } _fieldsTreeCache1.Nodes.Clear(); foreach (TreeNode node in treeView1.Nodes) { _fieldsTreeCache1.Nodes.Add((TreeNode)node.Clone()); } }
public void refresh_cleaners(TreeView treeView1, string settingsfile) { for (int i = 0; i < treeView1.Nodes.Count; i++) { treeView1.Nodes[i].Checked = DiskCleaner.secselection(treeView1.Nodes[i].Name, settingsfile); for (int j = 0; j < treeView1.Nodes[i].Nodes.Count; j++) { if (treeView1.Nodes[i].Nodes[j].Tag.ToString() == "chromium.cache") { MessageBox.Show(DiskCleaner.selection(treeView1.Nodes[i].Nodes[j].Tag.ToString(), settingsfile).ToString()); } treeView1.Nodes[i].Nodes[j].Checked = DiskCleaner.selection(treeView1.Nodes[i].Nodes[j].Tag.ToString(), settingsfile); } } }
public static void selectionload(TreeView treeView1, string settingsfile) { for (int i = 0; i < treeView1.Nodes.Count; i++) { treeView1.Nodes[i].Checked = DiskCleaner.secselection(treeView1.Nodes[i].Name, settingsfile); for (int j = 0; j < treeView1.Nodes[i].Nodes.Count; j++) { treeView1.Nodes[i].Nodes[j].Checked = DiskCleaner.selection(treeView1.Nodes[i].Nodes[j].Tag.ToString(), settingsfile); } } for (int i = 0; i < treeView1.Nodes.Count; i++) { for (int j = 0; j < treeView1.Nodes[i].Nodes.Count; j++) { if (treeView1.Nodes[i].Nodes[j].Checked == false) { treeView1.Nodes[i].Expand(); break; } } } treeView1.Nodes[0].EnsureVisible(); }
private void button4_Click(object sender, EventArgs e) { DiskCleaner.save_Cleaners(treeView1, "blb\\Bleachbit.ini"); this.Hide(); }
private void button3_Click(object sender, EventArgs e) { DiskCleaner.CheckUncheckTreeNode(treeView1.Nodes, false); }
private void Form1_Load(object sender, EventArgs e) { DiskCleaner.selectionload(treeView1, "blb\\Bleachbit.ini"); }
public void clean() { DiskCleaner.clean(treeView1, label1, textBox1); }
public void analyse() { DiskCleaner.analyse(treeView1, label1, textBox2, textBox1); }
private void treeView1_MouseLeave(object sender, EventArgs e) { DiskCleaner.save_Cleaners(treeView1, "blb\\Bleachbit.ini"); refresh_cleaners(DiskCleaner._fieldsTreeCache, "blb\\Bleachbit.ini"); }
public static void clean(TreeView treeView1, Label label1, TextBox textBox1) { log.WriteLog("Maintainer Diskclean clean start"); string series = null; if (treeView1.Nodes.Count == 0) { DiskCleaner.read_cleaners(treeView1, "blb\\Bleachbit.ini"); } for (int x = 0; x < treeView1.Nodes.Count; x++) { for (int y = 0; y < treeView1.Nodes[x].Nodes.Count; y++) { if (treeView1.Nodes[x].Nodes[y].Checked) { series = series + " " + treeView1.Nodes[x].Nodes[y].Tag; } } } ProcessStartInfo startInfo1 = new ProcessStartInfo("blb\\bleachbit_console.exe"); startInfo1.UseShellExecute = false; startInfo1.RedirectStandardInput = true; startInfo1.RedirectStandardOutput = true; startInfo1.Arguments = "--clean " + series; startInfo1.CreateNoWindow = true; startInfo1.WindowStyle = ProcessWindowStyle.Hidden; Process process1 = new Process(); process1.StartInfo = startInfo1; process1.Start(); List <string> output1 = new List <string>(); string lineVal1 = process1.StandardOutput.ReadLine(); string rem = null; string saved = ""; while (lineVal1 != null) { rem = rem + "\r\n" + lineVal1; output1.Add(lineVal1); lineVal1 = process1.StandardOutput.ReadLine(); Application.DoEvents(); } if (output1.Count > 4) { for (int s = 4; s > 1; s--) { if (output1[output1.Count - s].Length > 22) { if (output1[output1.Count - s].Substring(0, 22) == "Disk space recovered: ") { saved = output1[output1.Count - s].Substring(22); } } } } Global.cleanupsize = saved; log.WriteLog("Maintainer Diskclean clean end"); }
public static void analyse(TreeView treeView1, Label label1, TextBox textBox1, TextBox textBox2) { log.WriteLog("Maintainer Diskclean analysis start"); string series = null; if (treeView1.Nodes.Count == 0) { DiskCleaner.read_cleaners(treeView1, "blb\\Bleachbit.ini"); List <string> searchstring = new List <string>(); if (_fieldsTreeCache.Nodes.Count == 0) { foreach (TreeNode node in treeView1.Nodes) { _fieldsTreeCache.Nodes.Add((TreeNode)node.Clone()); } } treeView1.BeginUpdate(); treeView1.Nodes.Clear(); textBox2.Text = Global.cleanertext; Global.cleanertext = string.Empty; if (textBox2.Text != string.Empty) { for (int x = 0; x < _fieldsTreeCache.Nodes.Count; x++) { Match m1 = Regex.Match(_fieldsTreeCache.Nodes[x].Text, textBox2.Text, RegexOptions.IgnoreCase); if (m1.Success) { for (int y = 0; y < _fieldsTreeCache.Nodes[x].Nodes.Count; y++) { searchstring.Add(_fieldsTreeCache.Nodes[x].Nodes[y].Tag.ToString()); } } else { for (int y = 0; y < _fieldsTreeCache.Nodes[x].Nodes.Count; y++) { Match m = Regex.Match(_fieldsTreeCache.Nodes[x].Nodes[y].Tag.ToString(), textBox2.Text, RegexOptions.IgnoreCase); Match m2 = Regex.Match(_fieldsTreeCache.Nodes[x].Nodes[y].Text, textBox2.Text, RegexOptions.IgnoreCase); if (m.Success) { searchstring.Add(_fieldsTreeCache.Nodes[x].Nodes[y].Tag.ToString()); } else if (m2.Success) { searchstring.Add(_fieldsTreeCache.Nodes[x].Nodes[y].Tag.ToString()); } else { } } } } DiskCleaner.search_cleaners(treeView1, "blb\\Bleachbit.ini", searchstring); searchstring.Clear(); treeView1.ExpandAll(); } else { foreach (TreeNode _node in _fieldsTreeCache.Nodes) { treeView1.Nodes.Add((TreeNode)_node.Clone()); } treeView1.CheckBoxes = true; } //enables redrawing tree after all objects have been added treeView1.EndUpdate(); } for (int x = 0; x < treeView1.Nodes.Count; x++) { for (int y = 0; y < treeView1.Nodes[x].Nodes.Count; y++) { if (treeView1.Nodes[x].Nodes[y].Checked) { series = series + " " + treeView1.Nodes[x].Nodes[y].Tag; } } } try { ProcessStartInfo startInfo1 = new ProcessStartInfo("blb\\bleachbit_console.exe"); startInfo1.UseShellExecute = false; startInfo1.RedirectStandardInput = true; startInfo1.RedirectStandardOutput = true; startInfo1.Arguments = "--preview " + series; startInfo1.CreateNoWindow = true; startInfo1.WindowStyle = ProcessWindowStyle.Hidden; Process process1 = new Process(); process1.StartInfo = startInfo1; process1.Start(); List <string> output1 = new List <string>(); string lineVal1 = process1.StandardOutput.ReadLine(); string rem = null; string saved = ""; while (lineVal1 != null) { rem = rem + "\r\n" + lineVal1; output1.Add(lineVal1); lineVal1 = process1.StandardOutput.ReadLine(); Application.DoEvents(); } if (output1.Count > 4) { for (int s = 4; s > 1; s--) { if (output1[output1.Count - s].Length > 28) { if (output1[output1.Count - s].Substring(0, 28) == "Disk space to be recovered: ") { saved = output1[output1.Count - s].Substring(28); } } } } label1.Text = "Recoverable Size: " + saved; Global.cleanupsize = saved; textBox1.Text = rem; textBox1.SelectionStart = textBox1.Text.Length; textBox1.ScrollToCaret(); } catch { } log.WriteLog("Maintainer Diskclean analysis end"); }
public DiskCleanList() { InitializeComponent(); DiskCleaner.read_cleaners(treeView1, "blb\\Bleachbit.ini"); }