/// <summary> /// Initializes a new instance of the Disk class. Differencing disks are supported. /// </summary> /// <param name="file">The file containing the disk</param> /// <param name="ownsFile">Indicates if the new instance should control the lifetime of the file.</param> /// <param name="parentFile">The file containing the disk's parent</param> /// <param name="ownsParent">Indicates if the new instance should control the lifetime of the parentFile</param> private Disk(DiskImageFile file, Ownership ownsFile, DiskImageFile parentFile, Ownership ownsParent) { _files = new List <AlIO.Tuple <DiskImageFile, Ownership> >(); _files.Add(new AlIO.Tuple <DiskImageFile, Ownership>(file, ownsFile)); if (file.NeedsParent) { _files.Add(new AlIO.Tuple <DiskImageFile, Ownership>(parentFile, ownsParent)); ResolveFileChain(); } else { if (parentFile != null && ownsParent == Ownership.Dispose) { parentFile.Dispose(); } } }