internal DynamicDiskGroup(VirtualDisk disk) { _disks = new Dictionary<Guid, DynamicDisk>(); DynamicDisk dynDisk = new DynamicDisk(disk); _database = dynDisk.Database; _disks.Add(dynDisk.Id, dynDisk); _record = dynDisk.Database.GetDiskGroup(dynDisk.GroupId); }
internal DynamicDiskGroup(VirtualDisk disk) { _disks = new Dictionary <Guid, DynamicDisk>(); DynamicDisk dynDisk = new DynamicDisk(disk); _database = dynDisk.Database; _disks.Add(dynDisk.Id, dynDisk); _record = dynDisk.Database.GetDiskGroup(dynDisk.GroupId); }
internal DiskGroupRecord GetDiskGroup(Guid guid) { foreach (var record in _records.Values) { if (record.RecordType == RecordType.DiskGroup) { DiskGroupRecord dgRecord = (DiskGroupRecord)record; if (new Guid(dgRecord.GroupGuidString) == guid || guid == Guid.Empty) { return(dgRecord); } } } return(null); }
public static DatabaseRecord ReadFrom(byte[] buffer, int offset) { DatabaseRecord result = null; if (Utilities.ToInt32BigEndian(buffer, offset + 0xC) != 0) { switch ((RecordType)(buffer[offset + 0x13] & 0xF)) { case RecordType.Volume: result = new VolumeRecord(); break; case RecordType.Component: result = new ComponentRecord(); break; case RecordType.Extent: result = new ExtentRecord(); break; case RecordType.Disk: result = new DiskRecord(); break; case RecordType.DiskGroup: result = new DiskGroupRecord(); break; default: throw new NotImplementedException("Unrecognized record type: " + buffer[offset + 0x13]); } result.DoReadFrom(buffer, offset); } return result; }
public static DatabaseRecord ReadFrom(byte[] buffer, int offset) { DatabaseRecord result = null; if (Utilities.ToInt32BigEndian(buffer, offset + 0xC) != 0) { switch ((RecordType)(buffer[offset + 0x13] & 0xF)) { case RecordType.Volume: result = new VolumeRecord(); break; case RecordType.Component: result = new ComponentRecord(); break; case RecordType.Extent: result = new ExtentRecord(); break; case RecordType.Disk: result = new DiskRecord(); break; case RecordType.DiskGroup: result = new DiskGroupRecord(); break; default: throw new NotImplementedException("Unrecognized record type: " + buffer[offset + 0x13]); } result.DoReadFrom(buffer, offset); } return(result); }