1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
5 using System
.Collections
.ObjectModel
;
7 namespace Aga
.Controls
.Tree
11 [System
.Diagnostics
.CodeAnalysis
.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
12 public static readonly TreePath Empty
= new TreePath();
14 private object[] _path
;
15 public object[] FullPath
20 public object LastNode
25 return _path
[_path
.Length
- 1];
31 public object FirstNode
44 _path
= new object[0];
47 public TreePath(object node
)
49 _path
= new object[] { node }
;
52 public TreePath(object[] path
)
57 public TreePath(TreePath parent
, object node
)
59 _path
= new object[parent
.FullPath
.Length
+ 1];
60 for (int i
= 0; i
< _path
.Length
- 1; i
++)
61 _path
[i
] = parent
.FullPath
[i
];
62 _path
[_path
.Length
- 1] = node
;
67 return (_path
.Length
== 0);