public override void InitializeComInterfaces() { base.InitializeComInterfaces(); if (this.disk == null) { this.disk = InteropHelpers.QueryInterface <IVdsDisk>(base.ComUnknown); if (this.disk == null) { throw new VdsException("QueryInterface for IVdsDisk failed."); } } }
internal Disk(IVdsDisk vdsDisk, Guid id, string diskPath, string name, bool isRemovable, long capacity) { this.mDisk = vdsDisk; this.mId = id; this.DiskPath = diskPath; this.Name = name; this.IsRemovable = isRemovable; this.Capacity = capacity; Match m = rDiskPath.Match(diskPath); if (!m.Success) { throw new ArgumentException("Disk path was did unexpected: " + diskPath); } this.DiskNumber = int.Parse(m.Groups["num"].Value, CultureInfo.InvariantCulture); }
public Disk() { this.refresh = true; this.disk = null; }