示例#1
0
        public RootDirectory AddDirectory(string path)
        {
            RootDirectory result = new RootDirectory();

            RootDirectories.AddValue(result, path);
            return(result);
        }
示例#2
0
 internal DirectoryContainer(RootDirectory owner) : base(owner)
 {
     if (null != owner.Container)
     {
         throw new InvalidOperationException();
     }
 }
示例#3
0
        public FileNode AddFile(RootDirectory parent, string name, long length)
        {
            FileNode    result     = new FileNode();
            SingleFile  singleFile = SizeMappings.GetComponentByValue <SingleFile>(length);
            FilesBySize filesBySize;

            if (null != singleFile)
            {
                SizeMappings.Remove(singleFile);
                filesBySize = new FilesBySize();
                filesBySize.AddFile(singleFile);
                filesBySize.AddFile(result.Grouped);
            }
            else
            {
                filesBySize = SizeMappings.GetComponentByValue <FilesBySize>(length);
                if (null != filesBySize)
                {
                    filesBySize.AddFile(result.Grouped);
                }
                else
                {
                    SizeMappings.AddValue(result.Grouped, length);
                }
            }
            parent.AddFile(result.StructureNode, name);
            return(result);
        }