Exemplo n.º 1
0
        public FolderNode(FolderNode node, FolderNode parent) : base(node, parent)
        {
            fileCount   = node.fileCount;
            subdirCount = node.subdirCount;

            List <FileNodeBase> oldVirtualChildren = node.virtualChildren;
            int count = oldVirtualChildren.Count;

            if (count > 0)
            {
                virtualChildren = new List <FileNodeBase>(oldVirtualChildren.Count);
                for (int i = 0; i < count; i++)
                {
                    FileNodeBase child    = oldVirtualChildren[i];
                    FileNodeBase newChild = null;
                    if (child is FolderNode folder)
                    {
                        newChild = new FolderNode(folder, this);
                    }
                    else if (child is FileNode file)
                    {
                        newChild = new FileNode(file, this);
                    }
                    if (newChild != null)
                    {
                        Add(newChild);
                    }
                }
            }
        }
 public FileNodeEventArgs(FileNodeAction action, FileNodeBase child, int index = -1)
 {
     Action   = action;
     Children = new List <FileNodeBase> {
         child
     };
     Index = index;
 }