示例#1
0
 public void UpdateDirectoryInfo(DirEntry.UpdateHandle dir)
 {
     foreach (var device in os.Devices)
     {
         var name = device.name;
         var file = new MyFileEntry(name, mountPoint, true);
         file.guid = device.guid;
         dir.Files.Add(file);
     }
 }
示例#2
0
文件: SysFs.cs 项目: r2d2m/NIOS
 public void UpdateDirectoryInfo(DirEntry.UpdateHandle handle)
 {
     if (handle.DirEntry.FullName == mountPoint.FullName)
     {
         foreach (var device in os.Devices)
         {
             var name = device.name;
             var dir  = new MyDirEntry(name, mountPoint, true);
             dir.guid = device.guid;
             handle.Directories.Add(dir);
         }
     }
     else
     {
     }
 }
示例#3
0
    public void UpdateDirectoryInfo(DirEntry.UpdateHandle dir)
    {
        var path = mountPoint.GetRelativePathTo(dir.DirEntry);

        ulong id = 0;

        GetEntry(path, ref id);

        var filtered = entries.Where(e => e.Value.parentId == id).ToArray();
        var files    = filtered.Where(e => fileContents.ContainsKey(e.Key)).ToArray();
        var dirs     = filtered.Except(files).ToArray();

        foreach (var d in dirs)
        {
            dir.AddDirectory(d.Value.name);
        }
        foreach (var f in files)
        {
            dir.AddFile(f.Value.name);
        }
    }