mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-23 07:22:52 +08:00
Highlight multiple selection when clicking in project explorer
This commit is contained in:
parent
5cd2ebdd85
commit
6ed3996afa
@ -2264,6 +2264,16 @@ namespace CodeWalker.Project.Panels
|
|||||||
public event ProjectExplorerItemActivateHandler OnItemActivated;
|
public event ProjectExplorerItemActivateHandler OnItemActivated;
|
||||||
|
|
||||||
|
|
||||||
|
private void ClearSelectedNodes()
|
||||||
|
{
|
||||||
|
foreach (var node in SelectedNodes)
|
||||||
|
{
|
||||||
|
node.BackColor = Color.Empty;
|
||||||
|
node.ForeColor = Color.Empty;
|
||||||
|
}
|
||||||
|
SelectedNodes.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void ProjectTreeView_AfterSelect(object sender, TreeViewEventArgs e)
|
private void ProjectTreeView_AfterSelect(object sender, TreeViewEventArgs e)
|
||||||
{
|
{
|
||||||
@ -2273,6 +2283,8 @@ namespace CodeWalker.Project.Panels
|
|||||||
{
|
{
|
||||||
if (SelectedNodes.Contains(e.Node))
|
if (SelectedNodes.Contains(e.Node))
|
||||||
{
|
{
|
||||||
|
e.Node.BackColor = Color.Empty;
|
||||||
|
e.Node.ForeColor = Color.Empty;
|
||||||
SelectedNodes.Remove(e.Node);
|
SelectedNodes.Remove(e.Node);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2292,7 +2304,7 @@ namespace CodeWalker.Project.Panels
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool start = false;
|
bool start = false;
|
||||||
SelectedNodes.Clear();
|
ClearSelectedNodes();
|
||||||
foreach (TreeNode cnode in pnode.Nodes)
|
foreach (TreeNode cnode in pnode.Nodes)
|
||||||
{
|
{
|
||||||
if (start)
|
if (start)
|
||||||
@ -2316,7 +2328,7 @@ namespace CodeWalker.Project.Panels
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SelectedNodes.Clear();
|
ClearSelectedNodes();
|
||||||
SelectedNodes.Add(e.Node);
|
SelectedNodes.Add(e.Node);
|
||||||
}
|
}
|
||||||
if (SelectedNodes.Count > 1)
|
if (SelectedNodes.Count > 1)
|
||||||
@ -2324,6 +2336,8 @@ namespace CodeWalker.Project.Panels
|
|||||||
var objs = new List<object>();
|
var objs = new List<object>();
|
||||||
foreach (var node in SelectedNodes)
|
foreach (var node in SelectedNodes)
|
||||||
{
|
{
|
||||||
|
node.BackColor = SystemColors.Highlight;
|
||||||
|
node.ForeColor = SystemColors.HighlightText;
|
||||||
objs.Add(node.Tag);
|
objs.Add(node.Tag);
|
||||||
}
|
}
|
||||||
OnItemSelected?.Invoke(objs.ToArray());
|
OnItemSelected?.Invoke(objs.ToArray());
|
||||||
|
Loading…
Reference in New Issue
Block a user