CP-36392: Rename _selectedNodes to _internalSelectedNodes

To avoid getter naming confusion
Also rename `_seletedNodesWrapper` to `_selectedNodes`

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2021-09-20 09:34:13 +01:00
parent bb765e2b0f
commit f3d0b1f302
No known key found for this signature in database
GPG Key ID: 55F556F9A25CB037
2 changed files with 18 additions and 24 deletions

View File

@ -96,7 +96,7 @@ namespace XenAdmin.Controls
public int IndexOf(MultiSelectTreeNode item)
{
return _parent._selectedNodes.IndexOf(item);
return _parent._internalSelectedNodes.IndexOf(item);
}
public void Insert(int index, MultiSelectTreeNode item)
@ -108,7 +108,7 @@ namespace XenAdmin.Controls
public void RemoveAt(int index)
{
MultiSelectTreeNode item = _parent._selectedNodes[index];
MultiSelectTreeNode item = _parent._internalSelectedNodes[index];
_parent._selectionChanged = false;
_parent.SelectNode(item, false, TreeViewAction.Unknown);
_parent.OnSelectionsChanged();
@ -118,7 +118,7 @@ namespace XenAdmin.Controls
{
get
{
return _parent._selectedNodes[index];
return _parent._internalSelectedNodes[index];
}
set
{
@ -146,17 +146,17 @@ namespace XenAdmin.Controls
public bool Contains(MultiSelectTreeNode item)
{
return _parent._selectedNodes.Contains(item);
return _parent._internalSelectedNodes.Contains(item);
}
public void CopyTo(MultiSelectTreeNode[] array, int arrayIndex)
{
_parent._selectedNodes.CopyTo(array, arrayIndex);
_parent._internalSelectedNodes.CopyTo(array, arrayIndex);
}
public int Count
{
get { return _parent._selectedNodes.Count; }
get { return _parent._internalSelectedNodes.Count; }
}
public bool IsReadOnly
@ -179,7 +179,7 @@ namespace XenAdmin.Controls
public IEnumerator<MultiSelectTreeNode> GetEnumerator()
{
return _parent._selectedNodes.GetEnumerator();
return _parent._internalSelectedNodes.GetEnumerator();
}
#endregion

View File

@ -64,8 +64,8 @@ namespace XenAdmin.Controls
private bool _nodeProcessedOnMouseDown;
private bool _selectionChanged;
private bool _wasDoubleClick;
private readonly InternalSelectedNodeCollection _selectedNodes = new InternalSelectedNodeCollection();
private readonly MultiSelectTreeSelectedNodeCollection _selectedNodesWrapper;
private readonly InternalSelectedNodeCollection _internalSelectedNodes = new InternalSelectedNodeCollection();
private readonly MultiSelectTreeSelectedNodeCollection _selectedNodes;
private int intMouseClicks;
private TreeViewSelectionMode _selectionMode;
private MultiSelectTreeNode _keysStartNode;
@ -84,7 +84,7 @@ namespace XenAdmin.Controls
public MultiSelectTreeView()
{
_selectedNodesWrapper = new MultiSelectTreeSelectedNodeCollection(this);
_selectedNodes = new MultiSelectTreeSelectedNodeCollection(this);
_nodes = new MultiSelectTreeNodeCollection(this);
}
@ -185,7 +185,7 @@ namespace XenAdmin.Controls
private bool IsNodeSelected(MultiSelectTreeNode node)
{
return node != null && _selectedNodes.Contains(node);
return node != null && _internalSelectedNodes.Contains(node);
}
private bool IsPlusMinusClicked(MultiSelectTreeNode node, MouseEventArgs e)
@ -826,7 +826,7 @@ namespace XenAdmin.Controls
{
return false;
}
_selectedNodes.Add(node);
_internalSelectedNodes.Add(node);
selected = true;
_selectionChanged = true;
OnAfterSelect(new TreeViewEventArgs(node, tva));
@ -837,7 +837,7 @@ namespace XenAdmin.Controls
if (IsNodeSelected(node))
{
OnBeforeDeselect(new TreeViewEventArgs(node));
_selectedNodes.Remove(node);
_internalSelectedNodes.Remove(node);
_selectionChanged = true;
OnAfterDeselect(new TreeViewEventArgs(node));
@ -898,7 +898,7 @@ namespace XenAdmin.Controls
{
List<MultiSelectTreeNode> list = new List<MultiSelectTreeNode>();
foreach (MultiSelectTreeNode node in _selectedNodes)
foreach (MultiSelectTreeNode node in _internalSelectedNodes)
{
if (nodeKeepSelected == null)
{
@ -918,7 +918,7 @@ namespace XenAdmin.Controls
private void UnselectAllNodesNotBelongingDirectlyToParent(MultiSelectTreeNode parent, TreeViewAction tva)
{
ArrayList list = new ArrayList();
foreach (MultiSelectTreeNode node in _selectedNodes)
foreach (MultiSelectTreeNode node in _internalSelectedNodes)
{
if (node.Parent != parent)
{
@ -934,7 +934,7 @@ namespace XenAdmin.Controls
private void UnselectAllNodesNotBelongingToLevel(int level, TreeViewAction tva)
{
ArrayList list = new ArrayList();
foreach (MultiSelectTreeNode node in _selectedNodes)
foreach (MultiSelectTreeNode node in _internalSelectedNodes)
{
if (GetNodeLevel(node) != level)
{
@ -950,7 +950,7 @@ namespace XenAdmin.Controls
private void UnselectAllNodesNotBelongingToParent(MultiSelectTreeNode parent, TreeViewAction tva)
{
ArrayList list = new ArrayList();
foreach (MultiSelectTreeNode node in _selectedNodes)
foreach (MultiSelectTreeNode node in _internalSelectedNodes)
{
if (!IsChildOf(node, parent))
{
@ -1043,13 +1043,7 @@ namespace XenAdmin.Controls
}
}
public MultiSelectTreeSelectedNodeCollection SelectedNodes
{
get
{
return _selectedNodesWrapper;
}
}
public MultiSelectTreeSelectedNodeCollection SelectedNodes => _selectedNodes;
[DefaultValue(TreeViewSelectionMode.SingleSelect)]
public TreeViewSelectionMode SelectionMode