Use Create method for creating Device class.

This commit is contained in:
2022-03-26 17:46:59 +00:00
parent 9ec5aca447
commit d2d3bb560c
11 changed files with 290 additions and 281 deletions

View File

@@ -154,18 +154,15 @@ public sealed class MainWindowViewModel : ViewModelBase
_usbIcon =
new
Bitmap(_assets.Open(new
Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media-usb.png")));
Bitmap(_assets.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media-usb.png")));
_removableIcon =
new
Bitmap(_assets.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media.png")));
new Bitmap(_assets.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-removable-media.png")));
_sdIcon =
new Bitmap(_assets.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/media-flash-sd-mmc.png")));
_ejectIcon =
new Bitmap(_assets.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/media-eject.png")));
_ejectIcon = new Bitmap(_assets.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/media-eject.png")));
}
public bool DevicesSupported
@@ -251,7 +248,7 @@ public sealed class MainWindowViewModel : ViewModelBase
if(deviceModel.ViewModel is null)
try
{
var dev = new Device(deviceModel.Path);
var dev = Device.Create(deviceModel.Path);
if(dev.IsRemote)
Statistics.AddRemote(dev.RemoteApplication, dev.RemoteVersion,
@@ -790,7 +787,7 @@ public sealed class MainWindowViewModel : ViewModelBase
try
{
var dev = new Device(device.Path);
var dev = Device.Create(device.Path);
if(dev.IsRemote)
Statistics.AddRemote(dev.RemoteApplication, dev.RemoteVersion, dev.RemoteOperatingSystem,

View File

@@ -726,7 +726,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
try
{
_dev = new Device(_devicePath);
_dev = Device.Create(_devicePath);
if(_dev.IsRemote)
Statistics.AddRemote(_dev.RemoteApplication, _dev.RemoteVersion, _dev.RemoteOperatingSystem,

View File

@@ -328,7 +328,7 @@ public sealed class MediaScanViewModel : ViewModelBase
char.IsLetter(_devicePath[0]))
_devicePath = "\\\\.\\" + char.ToUpper(_devicePath[0]) + ':';
var dev = new Device(_devicePath);
var dev = Device.Create(_devicePath);
if(dev.IsRemote)
Statistics.AddRemote(dev.RemoteApplication, dev.RemoteVersion, dev.RemoteOperatingSystem,