コード例 #1
0
ファイル: VolumeManager.cs プロジェクト: sizious/gdi-builder
        private Dictionary <string, PhysicalVolumeInfo> ScanForPhysicalVolumes()
        {
            Dictionary <string, PhysicalVolumeInfo> result = new Dictionary <string, PhysicalVolumeInfo>();

            // First scan physical volumes
            for (int i = 0; i < _disks.Count; ++i)
            {
                VirtualDisk disk   = _disks[i];
                string      diskId = GetDiskId(i);

                if (PartitionTable.IsPartitioned(disk.Content))
                {
                    foreach (var table in PartitionTable.GetPartitionTables(disk))
                    {
                        foreach (var part in table.Partitions)
                        {
                            PhysicalVolumeInfo pvi = new PhysicalVolumeInfo(diskId, disk, part);
                            result.Add(pvi.Identity, pvi);
                        }
                    }
                }
                else
                {
                    PhysicalVolumeInfo pvi = new PhysicalVolumeInfo(diskId, disk);
                    result.Add(pvi.Identity, pvi);
                }
            }

            return(result);
        }
コード例 #2
0
 internal LogicalVolumeInfo(Guid guid, PhysicalVolumeInfo physicalVolume, SparseStreamOpenDelegate opener, long length, byte biosType, LogicalVolumeStatus status)
 {
     _guid        = guid;
     _physicalVol = physicalVolume;
     _opener      = opener;
     _length      = length;
     _biosType    = biosType;
     _status      = status;
 }
コード例 #3
0
 public abstract bool HandlesPhysicalVolume(PhysicalVolumeInfo volume);