Пример #1
0
        internal void InsertNode([NotNull] string path, [NotNull] FileSystemNode node)
        {
            var parts = IoHelpers.SplitPath(path);

            if (parts.Length != 2)
            {
                return;
            }
            var parentNode = GetOrCreateChild(parts[0]);

            node.name   = parts[1];
            node.parent = parentNode;
            parentNode.children.TryAdd(parts[1], node);

            var t = parentNode;

            while (t != null)
            {
                t.UpdateCounters(node.Size, node.CountDirectories, CountFiles);
                t = t.parent;
            }
        }
Пример #2
0
 private void OnCollectionChanged(NotifyCollectionChangedAction action, FileSystemNode node = null)
 {
     CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(action, node));
 }