1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
4 using System
.Collections
.Generic
;
6 using System
.Collections
;
8 namespace Aga
.Controls
.Tree
10 public class ListModel
: TreeModelBase
16 get { return _list.Count; }
21 _list
= new List
<object>();
24 public ListModel(IList list
)
29 public override IEnumerable
GetChildren(TreePath treePath
)
34 public override bool IsLeaf(TreePath treePath
)
39 public void AddRange(IEnumerable items
)
41 foreach (object obj
in items
)
43 OnStructureChanged(new TreePathEventArgs(TreePath
.Empty
));
46 public void Add(object item
)
49 OnNodesInserted(new TreeModelEventArgs(TreePath
.Empty
, new int[] { _list.Count - 1 }
, new object[] { item }
));
55 OnStructureChanged(new TreePathEventArgs(TreePath
.Empty
));