Exemplo n.º 1
0
        public OricProgram LoadFile()
        {
            OricProgram oricProgram = new OricProgram();

            oricProgram.New();

            if (MediaType == ConstantsAndEnums.MediaType.TapeFile)
            {
                OricTape oricTape = new OricTape();
                oricProgram = oricTape.Load(Path.Combine(Folder, ParentName), ProgramName, ProgramIndex);
            }
            else
            {
                OricDisk oricDisk = new OricDisk();
                oricDisk.LoadDisk(ParentName);

                switch (oricDisk.DOSFormat())
                {
                case OricDisk.DOSFormats.OricDOS:
                {
                    OricDos oricDisc = new OricDos();
                    oricProgram = oricDisc.LoadFile(ParentName, this);
                }
                break;

                case OricDisk.DOSFormats.SedOric:
                {
                    SedOric oricDisc = new SedOric();
                    oricProgram = oricDisc.LoadFile(ParentName, this);
                }
                break;

                case OricDisk.DOSFormats.StratSed:
                {
                    StratSed oricDisc = new StratSed();
                    oricProgram = oricDisc.LoadFile(ParentName, this);
                }
                break;

                case OricDisk.DOSFormats.TDOS:
                {
                    FTDos oricDisc = new FTDos();
                    oricProgram = oricDisc.LoadFile(ParentName, this);
                }
                break;

                default:
                    break;
                }
            }

            return(oricProgram);
        }
Exemplo n.º 2
0
        public OricDiskInfo(String diskPathName)
        {
            fullName = diskPathName;

            oricDisk = new OricDisk();
            oricDisk.LoadDisk(fullName);

            dosFormat  = oricDisk.DOSFormat();
            dosVersion = oricDisk.DOSVersion();

            switch (dosFormat)
            {
            case OricDisk.DOSFormats.OricDOS:
            {
                OricDos oricDisc = new OricDos();
                oricDisc.GetDiskInfo(fullName);

                nextAvailableSector = (ushort)oricDisc.nextAvailableSector;
                nextAvailableTrack  = (ushort)oricDisc.nextAvailableTrack;

                diskName = oricDisc.diskName;
                diskType = oricDisc.diskType;

                sectors     = oricDisc.sectors;
                freeSectors = oricDisc.sectorsFree;
                usedSectors = oricDisc.sectorsUsed;

                noOfSides       = oricDisc.sides;
                tracksPerSide   = oricDisc.tracksPerSide;
                sectorsPerTrack = oricDisc.sectorsPerTrack;

                fileCount = oricDisc.fileCount;
            }
            break;

            case OricDisk.DOSFormats.SedOric:
            {
                SedOric oricDisc = new SedOric();
                oricDisc.GetDiskInfo(fullName);

                diskName = oricDisc.diskName;
                diskType = oricDisc.diskType;

                sectors     = oricDisc.sectors;
                freeSectors = oricDisc.sectorsFree;
                usedSectors = oricDisc.sectorsUsed;

                noOfSides       = oricDisc.sides;
                tracksPerSide   = oricDisc.tracksPerSide;
                sectorsPerTrack = oricDisc.sectorsPerTrack;

                fileCount = oricDisc.noOfFiles;
            }
            break;

            case OricDisk.DOSFormats.StratSed:
            {
                SedOric oricDisc = new SedOric();
                oricDisc.GetDiskInfo(fullName);

                diskName = oricDisc.diskName;
                diskType = oricDisc.diskType;

                sectors     = oricDisc.sectors;
                freeSectors = oricDisc.sectorsFree;
                usedSectors = oricDisc.sectorsUsed;

                noOfSides       = oricDisc.sides;
                tracksPerSide   = oricDisc.tracksPerSide;
                sectorsPerTrack = oricDisc.sectorsPerTrack;

                fileCount = oricDisc.noOfFiles;
            }
            break;

            case OricDisk.DOSFormats.TDOS:
            {
                FTDos oricDisc = new FTDos();
                oricDisc.GetDiskInfo(fullName);

                diskName = oricDisc.diskName;
                diskType = oricDisc.diskType;

                sectors     = oricDisc.sectors;
                freeSectors = oricDisc.sectorsFree;
                usedSectors = oricDisc.sectorsUsed;

                noOfSides       = oricDisc.sides;
                tracksPerSide   = oricDisc.tracksPerSide;
                sectorsPerTrack = oricDisc.sectorsPerTrack;

                fileCount = oricDisc.noOfFiles;
            }
            break;

            default:
                break;
            }

            creationTime   = File.GetCreationTime(diskPathName);
            lastAccessTime = File.GetLastAccessTime(diskPathName);
            lastWriteTime  = File.GetLastWriteTime(diskPathName);
        }
Exemplo n.º 3
0
        public OricDiskInfo(string diskPathName)
        {
            FullName = diskPathName;

            oricDisk = new OricDisk();
            oricDisk.LoadDisk(FullName);

            DOSFormat  = oricDisk.DOSFormat();
            DOSVersion = oricDisk.DOSVersion();

            switch (DOSFormat)
            {
            case OricDisk.DOSFormats.OricDOS:
            {
                OricDos oricDisc = new OricDos();
                oricDisc.GetDiskInfo(FullName);

                nextAvailableSector = (ushort)oricDisc.nextAvailableSector;
                nextAvailableTrack  = (ushort)oricDisc.nextAvailableTrack;

                DiskName = oricDisc.diskName;
                DiskType = oricDisc.diskType;

                Sectors     = oricDisc.sectors;
                SectorsFree = oricDisc.sectorsFree;
                SectorsUsed = oricDisc.sectorsUsed;

                Sides           = oricDisc.sides;
                TracksPerSide   = oricDisc.tracksPerSide;
                SectorsPerTrack = oricDisc.sectorsPerTrack;

                FileCount = oricDisc.fileCount;
            }
            break;

            case OricDisk.DOSFormats.SedOric:
            {
                SedOric oricDisc = new SedOric();
                oricDisc.GetDiskInfo(FullName);

                DiskName = oricDisc.diskName;
                DiskType = oricDisc.diskType;

                Sectors     = oricDisc.sectors;
                SectorsFree = oricDisc.sectorsFree;
                SectorsUsed = oricDisc.sectorsUsed;

                Sides           = oricDisc.sides;
                TracksPerSide   = oricDisc.tracksPerSide;
                SectorsPerTrack = oricDisc.sectorsPerTrack;

                FileCount = oricDisc.noOfFiles;
            }
            break;

            case OricDisk.DOSFormats.StratSed:
            {
                SedOric oricDisc = new SedOric();
                oricDisc.GetDiskInfo(FullName);

                DiskName = oricDisc.diskName;
                DiskType = oricDisc.diskType;

                Sectors     = oricDisc.sectors;
                SectorsFree = oricDisc.sectorsFree;
                SectorsUsed = oricDisc.sectorsUsed;

                Sides           = oricDisc.sides;
                TracksPerSide   = oricDisc.tracksPerSide;
                SectorsPerTrack = oricDisc.sectorsPerTrack;

                FileCount = oricDisc.noOfFiles;
            }
            break;

            case OricDisk.DOSFormats.TDOS:
            {
                FTDos oricDisc = new FTDos();
                oricDisc.GetDiskInfo(FullName);

                DiskName = oricDisc.diskName;
                DiskType = oricDisc.diskType;

                Sectors     = oricDisc.sectors;
                SectorsFree = oricDisc.sectorsFree;
                SectorsUsed = oricDisc.sectorsUsed;

                Sides           = oricDisc.sides;
                TracksPerSide   = oricDisc.tracksPerSide;
                SectorsPerTrack = oricDisc.sectorsPerTrack;

                FileCount = oricDisc.noOfFiles;
            }
            break;

            default:
                break;
            }

            if (this.GetFiles() == null)
            {
                DOSFormat = OricDisk.DOSFormats.Unknown;
            }

            CreationTime   = File.GetCreationTime(diskPathName);
            LastAccessTime = File.GetLastAccessTime(diskPathName);
            LastWriteTime  = File.GetLastWriteTime(diskPathName);
        }