Ejemplo n.º 1
0
        internal void AddDisk(ulong device, ulong disk, string diskName)
        {
            var d = Select(device, disk);

            if (d == null)
            {
                d = new MyDisk(disk, diskName);
                devices.Find(i => { return(i.Id == device); }).disks.Add(d);
                Directory.CreateDirectory(String.Format("{0}\\FileInfo\\{1}\\File", Managers.FileManager.PathToHFOFolder, d.Id));
                Directory.CreateDirectory(String.Format("{0}\\FileInfo\\{1}\\Folder", Managers.FileManager.PathToHFOFolder, d.Id));
                Directory.CreateDirectory(String.Format("{0}\\FileInfo\\{1}\\ItemFiles", Managers.FileManager.PathToHFOFolder, d.Id));
            }
        }
Ejemplo n.º 2
0
        internal MyDisk AddDisk(string name)
        {
            byte[] buff = new byte[sizeof(ulong)];
            Random r    = new Random();
            ulong  id   = 0;

            do
            {
                r.NextBytes(buff);
                id = BitConverter.ToUInt64(buff, 0);
            } while (disks.Find((x) => { return(x.Id == id); }) != null);
            var dis = new MyDisk(id, name);

            disks.Add(dis);
            return(dis);
        }
Ejemplo n.º 3
0
 internal void Remove(MyDisk disk)
 {
     disks.Remove(disk);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create instance of root folder.
 /// </summary>
 /// <param name="path">path from disk root</param>
 /// <param name="dsk">disk where is this folder</param>
 /// <param name="cat">Category in which is folder placed</param>
 public MyRootFolder(string path, MyDisk dsk, Category cat)
 {
     this.Path = path;
     Disk      = dsk;
     Category  = cat;
 }
Ejemplo n.º 5
0
 internal MyDevice GetDevice(MyDisk d)
 {
     return(devices.Find(i => { return i.disks.Contains(d); }));
 }
Ejemplo n.º 6
0
 public AppTreePosition(MyDevice dev, MyDisk dis, IInfoGetter file)
 {
     Device = dev;
     Disk   = dis;
     File   = file;
 }