From 93b535ab293e9ff63308479f46c658f84f14fbf0 Mon Sep 17 00:00:00 2001 From: pointfeev Date: Fri, 5 Nov 2021 01:46:57 -0400 Subject: [PATCH] Update SelectForm.cs --- CreamInstaller/SelectForm.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CreamInstaller/SelectForm.cs b/CreamInstaller/SelectForm.cs index f027319..aaaf554 100644 --- a/CreamInstaller/SelectForm.cs +++ b/CreamInstaller/SelectForm.cs @@ -308,21 +308,21 @@ namespace CreamInstaller scanButton.Enabled = true; } - private void OnChange(object sender, TreeViewEventArgs e) + private void OnTreeViewNodeCheckedChanged(object sender, TreeViewEventArgs e) { ProgramSelection selection = Program.ProgramSelections.ToList().Find(selection => selection.DisplayName == e.Node.Text); if (selection is null) { - treeView1.AfterCheck -= OnChange; + treeView1.AfterCheck -= OnTreeViewNodeCheckedChanged; e.Node.Parent.Checked = e.Node.Parent.Nodes.Cast().ToList().Any(treeNode => treeNode.Checked); - treeView1.AfterCheck += OnChange; + treeView1.AfterCheck += OnTreeViewNodeCheckedChanged; } else { selection.Toggle(e.Node.Checked); - treeView1.AfterCheck -= OnChange; + treeView1.AfterCheck -= OnTreeViewNodeCheckedChanged; e.Node.Nodes.Cast().ToList().ForEach(treeNode => treeNode.Checked = e.Node.Checked); - treeView1.AfterCheck += OnChange; + treeView1.AfterCheck += OnTreeViewNodeCheckedChanged; acceptButton.Enabled = Program.ProgramSelections.ToList().Any(selection => selection.Enabled); allCheckBox.CheckedChanged -= OnAllCheckBoxChanged; allCheckBox.Checked = treeNodes.TrueForAll(treeNode => treeNode.Checked); @@ -333,7 +333,7 @@ namespace CreamInstaller private void OnLoad(object sender, EventArgs e) { treeView1.BeforeCollapse += (sender, e) => e.Cancel = true; - treeView1.AfterCheck += OnChange; + treeView1.AfterCheck += OnTreeViewNodeCheckedChanged; OnLoad(); }