!B (Sandbox) (CE-21795) Importing models with multisubmaterials via fbx switches...
[CRYENGINE.git] / Code / Tools / LuaRemoteDebugger / Aga.Controls / Tree / ListModel.cs
blobb96c3cd253bd21943a6bba81db475cb3cc6e2090
1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
3 using System;
4 using System.Collections.Generic;
5 using System.Text;
6 using System.Collections;
8 namespace Aga.Controls.Tree
10 public class ListModel : TreeModelBase
12 private IList _list;
14 public int Count
16 get { return _list.Count; }
19 public ListModel()
21 _list = new List<object>();
24 public ListModel(IList list)
26 _list = list;
29 public override IEnumerable GetChildren(TreePath treePath)
31 return _list;
34 public override bool IsLeaf(TreePath treePath)
36 return true;
39 public void AddRange(IEnumerable items)
41 foreach (object obj in items)
42 _list.Add(obj);
43 OnStructureChanged(new TreePathEventArgs(TreePath.Empty));
46 public void Add(object item)
48 _list.Add(item);
49 OnNodesInserted(new TreeModelEventArgs(TreePath.Empty, new int[] { _list.Count - 1 }, new object[] { item }));
52 public void Clear()
54 _list.Clear();
55 OnStructureChanged(new TreePathEventArgs(TreePath.Empty));