Exemple #1
0
 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.");
         }
     }
 }
Exemple #2
0
        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);
        }
Exemple #3
0
 public Disk()
 {
     this.refresh = true;
     this.disk    = null;
 }