コード例 #1
0
 internal TreeItem(string id, string parent, ref TreeCollection <T> ownerCollection)
 {
     _id              = id;
     _parent          = parent;
     _ownerCollection = ownerCollection;
     _subitems        = new LightCollection <string>();
 }
コード例 #2
0
ファイル: TreeCollection.cs プロジェクト: NTDLS/SyntaxBox
        public LightCollection <TreeItem <T> > Find(Predicate <TreeItem <T> > match)
        {
            LightCollection <TreeItem <T> > results = new LightCollection <TreeItem <T> >();

            for (int i = 0; i < _globalCollection.Count; i++)
            {
                if (match(_globalCollection[i]))
                {
                    results.Add(_globalCollection[i]);
                }
            }
            return(results);
        }
コード例 #3
0
        public string GetFullPath()
        {
            LightCollection <string> paths = new LightCollection <string>();

            paths.Add(_id);
            TreeItem <T> parent = this.Parent;

            while (parent != null)
            {
                paths.Add(parent.Id);
                parent = parent.Parent;
            }
            paths.Reverse();
            string fullPath = string.Join("/", paths.GetItems());

            return(fullPath);
        }
コード例 #4
0
 internal Enumerator(LightCollection <T> list)
 {
     _list    = list;
     _index   = 0;
     _current = default(T);
 }
コード例 #5
0
 internal TreeItemEnumerator(ref KeyedCollection <TreeItem <T> > globalCollection, LightCollection <string> rootItems)
 {
     _globalCollection = globalCollection;
     _rootItems        = rootItems;
 }
コード例 #6
0
 public KeyedCollection(string[] keys, T[] items)
 {
     _keys         = new LightCollection <string>(keys);
     _items        = new LightCollection <T>(items);
     _readonlyColl = null;
 }
コード例 #7
0
 public KeyedCollection(int initialSize)
 {
     _keys         = new LightCollection <string>(initialSize);
     _items        = new LightCollection <T>(initialSize);
     _readonlyColl = null;
 }
コード例 #8
0
ファイル: TreeCollection.cs プロジェクト: NTDLS/SyntaxBox
 public TreeCollection(int initialSize)
 {
     _globalCollection = new KeyedCollection <TreeItem <T> >(initialSize);
     _globalValues     = new KeyedCollection <T>(initialSize);
     _rootItems        = new LightCollection <string>();
 }
コード例 #9
0
 public ReadOnlyCollection(ILightCollection <T> collection)
 {
     _coll = (LightCollection <T>)collection; // new LightCollection<T>(collection);
 }
コード例 #10
0
 public ReadOnlyCollection(T[] array)
 {
     _coll = new LightCollection <T>(array);
 }
コード例 #11
0
ファイル: TreeItemCollection.cs プロジェクト: NTDLS/SyntaxBox
 internal TreeItemCollection(ref TreeCollection <T> ownerCollection, string parent, LightCollection <string> items)
 {
     _parent          = parent;
     _items           = new LightCollection <string>(items);
     _ownerCollection = ownerCollection;
 }