public DiskImage(String filename, DiskContents contents) { _filename = filename; Contents = contents; if (contents != null) { Contents.logical = new LogicalContents(); } }
public override PhysicalContents Read() { if (Contents == null) { Contents = new DiskContents(); } Contents.physical = PerformRead(); SetGeometry(); return(Contents.physical); }
public static LogicalEntity CreateDisk(string filename, DiskType diskType, DiskContents contents) { DiskImage created = null; DiskType typeToCreate = diskType; if (typeToCreate == DiskType.UNSPECIFIED) { string ext = System.IO.Path.GetExtension(filename).ToUpper(); if (ext.Length > 1) { ext = ext.Substring(1); // remove the dot if (DiskExtensions.ContainsKey(ext)) { ext = DiskExtensions[ext]; // convert to standard extension } if (!Enum.TryParse(ext, out typeToCreate)) { typeToCreate = DiskType.UNSPECIFIED; } } } switch (typeToCreate) { case DiskType.DMK: created = new DMKImage(filename, contents); break; case DiskType.DSK: created = new DSKImage(filename, contents); break; case DiskType.HD: created = new HDImage(filename, contents); break; case DiskType.PDI: created = new PDIImage(filename, contents); break; case DiskType.SVI: break; } LogicalEntity entity = new LogicalDisk(); entity.diskImage = created; return(entity); }
public DiskImage(String filename) { _filename = filename; Contents = null; }
public FloppyImage(string filename, DiskContents contents) : base(filename, contents) { }
public PDIImage(string filename, DiskContents contents) : base(filename, contents) { }
public FATBasedImage(string filename, DiskContents contents) : base(filename, contents) { _geometry = new Geometry(); }