🎨REFACTOR: Use auto-properties.

This commit is contained in:
2017-12-26 08:01:40 +00:00
parent 94d8173b3a
commit 18f9a349c9
80 changed files with 947 additions and 1134 deletions

View File

@@ -32,19 +32,16 @@
using System;
using System.Collections.Generic;
using Claunia.Encoding;
using DiscImageChef.CommonTypes;
using System.Text;
using DiscImageChef.DiscImages;
using Schemas;
using Encoding = System.Text.Encoding;
namespace DiscImageChef.Filesystems.AppleDOS
{
public partial class AppleDOS : IReadOnlyFilesystem
{
IMediaImage device;
Encoding currentEncoding;
bool debug;
IMediaImage device;
bool mounted;
int sectorsPerTrack;
ulong start;
@@ -55,9 +52,8 @@ namespace DiscImageChef.Filesystems.AppleDOS
Vtoc vtoc;
FileSystemType xmlFsType;
public FileSystemType XmlFsType => xmlFsType;
public Encoding Encoding => currentEncoding;
public FileSystemType XmlFsType { get; private set; }
public Encoding Encoding { get; private set; }
public string Name => "Apple DOS File System";
public Guid Id => new Guid("8658A1E9-B2E7-4BCC-9638-157A31B0A700\n");

View File

@@ -111,7 +111,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
// Apple DOS has high byte set over ASCII.
for(int i = 0; i < 30; i++) filenameB[i] = (byte)(entry.filename[i] & 0x7F);
string filename = StringHandlers.SpacePaddedToString(filenameB, currentEncoding);
string filename = StringHandlers.SpacePaddedToString(filenameB, Encoding);
if(!catalogCache.ContainsKey(filename)) catalogCache.Add(filename, ts);

View File

@@ -63,10 +63,11 @@ namespace DiscImageChef.Filesystems.AppleDOS
vtoc.sectorsPerTrack == spt && vtoc.bytesPerSector == 256;
}
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information,
Encoding encoding)
{
// TODO: Until Apple ][ encoding is implemented
currentEncoding = new LisaRoman();
Encoding = new LisaRoman();
information = "";
StringBuilder sb = new StringBuilder();
@@ -95,7 +96,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
information = sb.ToString();
xmlFsType = new FileSystemType
XmlFsType = new FileSystemType
{
Bootable = true,
Clusters = (long)imagePlugin.Info.Sectors,

View File

@@ -51,8 +51,8 @@ namespace DiscImageChef.Filesystems.AppleDOS
device = imagePlugin;
start = partition.Start;
// TODO: Until Apple ][ encoding is implemented
currentEncoding = new LisaRoman();
Encoding = new LisaRoman();
if(device.Info.Sectors != 455 && device.Info.Sectors != 560)
{
DicConsole.DebugWriteLine("Apple DOS plugin", "Incorrect device size.");
@@ -100,7 +100,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
}
// Create XML metadata for mounted filesystem
xmlFsType = new FileSystemType
XmlFsType = new FileSystemType
{
Bootable = true,
Clusters = (long)device.Info.Sectors,
@@ -110,7 +110,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
FreeClustersSpecified = true,
Type = "Apple DOS"
};
xmlFsType.FreeClusters = xmlFsType.Clusters - usedSectors;
XmlFsType.FreeClusters = XmlFsType.Clusters - usedSectors;
this.debug = debug;
mounted = true;