Move DeviceType to CommonTypes.

This commit is contained in:
2018-11-27 00:09:53 +00:00
parent f118287dfb
commit 6a2fc9f76b
23 changed files with 43 additions and 25 deletions

View File

@@ -95,6 +95,7 @@
<e p="DiscImageChef.CommonTypes" t="IncludeRecursive"> <e p="DiscImageChef.CommonTypes" t="IncludeRecursive">
<e p="DiscImageChef.CommonTypes.csproj" t="IncludeRecursive" /> <e p="DiscImageChef.CommonTypes.csproj" t="IncludeRecursive" />
<e p="Enums" t="Include"> <e p="Enums" t="Include">
<e p="DeviceType.cs" t="Include" />
<e p="Images.cs" t="Include" /> <e p="Images.cs" t="Include" />
</e> </e>
<e p="Exceptions" t="Include"> <e p="Exceptions" t="Include">

View File

@@ -49,6 +49,7 @@
<Compile Include="..\CICMMetadata\dotnet\cicm.cs"> <Compile Include="..\CICMMetadata\dotnet\cicm.cs">
<Link>Metadata/cicm.cs</Link> <Link>Metadata/cicm.cs</Link>
</Compile> </Compile>
<Compile Include="Enums\DeviceType.cs" />
<Compile Include="Enums\Images.cs" /> <Compile Include="Enums\Images.cs" />
<Compile Include="Exceptions\Images.cs" /> <Compile Include="Exceptions\Images.cs" />
<Compile Include="Extents\ExtentsByte.cs" /> <Compile Include="Extents\ExtentsByte.cs" />

View File

@@ -0,0 +1,13 @@
namespace DiscImageChef.CommonTypes.Enums
{
public enum DeviceType
{
Unknown,
ATA,
ATAPI,
SCSI,
SecureDigital,
MMC,
NVMe
}
}

View File

@@ -32,6 +32,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Decoders.ATA; using DiscImageChef.Decoders.ATA;
using DiscImageChef.Decoders.SCSI; using DiscImageChef.Decoders.SCSI;

View File

@@ -31,6 +31,7 @@
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic; using System.Collections.Generic;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Decoders.ATA; using DiscImageChef.Decoders.ATA;
using DiscImageChef.Decoders.SCSI; using DiscImageChef.Decoders.SCSI;
using DiscImageChef.Decoders.SCSI.SSC; using DiscImageChef.Decoders.SCSI.SSC;

View File

@@ -31,6 +31,7 @@
// ****************************************************************************/ // ****************************************************************************/
using System; using System;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Decoders.ATA; using DiscImageChef.Decoders.ATA;
using DiscImageChef.Devices; using DiscImageChef.Devices;
@@ -123,15 +124,11 @@ namespace DiscImageChef.Core.Devices
} }
} }
internal bool ReadBlock(out byte[] buffer, ulong block, out double duration) internal bool ReadBlock(out byte[] buffer, ulong block, out double duration) =>
{ ReadBlocks(out buffer, block, 1, out duration);
return ReadBlocks(out buffer, block, 1, out duration);
}
internal bool ReadBlocks(out byte[] buffer, ulong block, out double duration) internal bool ReadBlocks(out byte[] buffer, ulong block, out double duration) =>
{ ReadBlocks(out buffer, block, BlocksToRead, out duration);
return ReadBlocks(out buffer, block, BlocksToRead, out duration);
}
internal bool ReadBlocks(out byte[] buffer, ulong block, uint count, out double duration) internal bool ReadBlocks(out byte[] buffer, ulong block, uint count, out double duration)
{ {

View File

@@ -31,9 +31,9 @@
// ****************************************************************************/ // ****************************************************************************/
using System; using System;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Decoders.ATA; using DiscImageChef.Decoders.ATA;
using DiscImageChef.Devices;
namespace DiscImageChef.Core.Devices namespace DiscImageChef.Core.Devices
{ {

View File

@@ -30,9 +30,9 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.CommonTypes.Metadata; using DiscImageChef.CommonTypes.Metadata;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Devices;
namespace DiscImageChef.Core.Devices.Report namespace DiscImageChef.Core.Devices.Report
{ {

View File

@@ -32,6 +32,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Core.Logging; using DiscImageChef.Core.Logging;
using DiscImageChef.Decoders.MMC; using DiscImageChef.Decoders.MMC;

View File

@@ -34,6 +34,7 @@ using System;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Text; using System.Text;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Devices; using DiscImageChef.Devices;
namespace DiscImageChef.Core.Logging namespace DiscImageChef.Core.Logging

View File

@@ -37,6 +37,7 @@ using System.Linq;
using System.Threading; using System.Threading;
using DiscImageChef.Checksums; using DiscImageChef.Checksums;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Core.Media.Detection; using DiscImageChef.Core.Media.Detection;
using DiscImageChef.Decoders.CD; using DiscImageChef.Decoders.CD;

View File

@@ -35,6 +35,7 @@ using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.CommonTypes.Interop; using DiscImageChef.CommonTypes.Interop;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Decoders.ATA; using DiscImageChef.Decoders.ATA;
@@ -475,7 +476,9 @@ namespace DiscImageChef.Devices
// I have to search for USB disks, floppies and CD-ROMs as separate device types // I have to search for USB disks, floppies and CD-ROMs as separate device types
foreach(string devGuid in new[] foreach(string devGuid in new[]
{Usb.GuidDevinterfaceFloppy, Usb.GuidDevinterfaceCdrom, Usb.GuidDevinterfaceDisk}) {
Usb.GuidDevinterfaceFloppy, Usb.GuidDevinterfaceCdrom, Usb.GuidDevinterfaceDisk
})
{ {
usbDevice = Usb.FindDrivePath(devicePath, devGuid); usbDevice = Usb.FindDrivePath(devicePath, devGuid);
if(usbDevice != null) break; if(usbDevice != null) break;

View File

@@ -30,6 +30,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.CommonTypes.Interop; using DiscImageChef.CommonTypes.Interop;
using DiscImageChef.Decoders.SCSI; using DiscImageChef.Decoders.SCSI;

View File

@@ -37,17 +37,6 @@ using System;
namespace DiscImageChef.Devices namespace DiscImageChef.Devices
{ {
public enum DeviceType
{
Unknown,
ATA,
ATAPI,
SCSI,
SecureDigital,
MMC,
NVMe
}
#region ATA Commands #region ATA Commands
/// <summary> /// <summary>
/// All known ATA commands /// All known ATA commands

View File

@@ -39,6 +39,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Xml.Serialization; using System.Xml.Serialization;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.CommonTypes.Interfaces; using DiscImageChef.CommonTypes.Interfaces;
using DiscImageChef.CommonTypes.Metadata; using DiscImageChef.CommonTypes.Metadata;
using DiscImageChef.Core; using DiscImageChef.Core;

View File

@@ -36,6 +36,7 @@ using System.ComponentModel;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.CommonTypes.Interfaces; using DiscImageChef.CommonTypes.Interfaces;
using DiscImageChef.CommonTypes.Structs; using DiscImageChef.CommonTypes.Structs;
using DiscImageChef.Console; using DiscImageChef.Console;

View File

@@ -32,6 +32,7 @@
using System; using System;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Core; using DiscImageChef.Core;
using DiscImageChef.Core.Devices.Scanning; using DiscImageChef.Core.Devices.Scanning;
using DiscImageChef.Core.Media.Info; using DiscImageChef.Core.Media.Info;
@@ -68,8 +69,8 @@ namespace DiscImageChef.Gui.Forms
// TODO: Allow to save MHDD and ImgBurn log files // TODO: Allow to save MHDD and ImgBurn log files
void OnBtnScanClick(object sender, EventArgs e) void OnBtnScanClick(object sender, EventArgs e)
{ {
btnStop.Visible = true; btnStop.Visible = true;
btnScan.Visible = false; btnScan.Visible = false;
btnCancel.Visible = false; btnCancel.Visible = false;
if(devicePath.Length == 2 && devicePath[1] == ':' && devicePath[0] != '/' && char.IsLetter(devicePath[0])) if(devicePath.Length == 2 && devicePath[1] == ':' && devicePath[0] != '/' && char.IsLetter(devicePath[0]))

View File

@@ -30,7 +30,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using DiscImageChef.Devices; using DiscImageChef.CommonTypes.Enums;
using Eto.Forms; using Eto.Forms;
using Eto.Serialization.Xaml; using Eto.Serialization.Xaml;

View File

@@ -31,6 +31,7 @@
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic; using System.Collections.Generic;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Core; using DiscImageChef.Core;
using DiscImageChef.Decoders.ATA; using DiscImageChef.Decoders.ATA;

View File

@@ -34,6 +34,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.CommonTypes.Metadata; using DiscImageChef.CommonTypes.Metadata;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Core; using DiscImageChef.Core;

View File

@@ -37,6 +37,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Xml.Serialization; using System.Xml.Serialization;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.CommonTypes.Interfaces; using DiscImageChef.CommonTypes.Interfaces;
using DiscImageChef.CommonTypes.Metadata; using DiscImageChef.CommonTypes.Metadata;
using DiscImageChef.Console; using DiscImageChef.Console;

View File

@@ -32,6 +32,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Core; using DiscImageChef.Core;
using DiscImageChef.Core.Media.Info; using DiscImageChef.Core.Media.Info;

View File

@@ -31,6 +31,7 @@
// ****************************************************************************/ // ****************************************************************************/
using System; using System;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Core.Devices.Scanning; using DiscImageChef.Core.Devices.Scanning;
using DiscImageChef.Devices; using DiscImageChef.Devices;