mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Migrate sd/mmc info from Eto.Forms to Avalonia.
This commit is contained in:
57
Aaru.Gui/ViewModels/SdMmcInfoViewModel.cs
Normal file
57
Aaru.Gui/ViewModels/SdMmcInfoViewModel.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
namespace Aaru.Gui.ViewModels
|
||||
{
|
||||
public class SdMmcInfoViewModel
|
||||
{
|
||||
public SdMmcInfoViewModel(DeviceType deviceType, byte[] cid, byte[] csd, byte[] ocr, byte[] extendedCsd,
|
||||
byte[] scr)
|
||||
{
|
||||
switch(deviceType)
|
||||
{
|
||||
case DeviceType.MMC:
|
||||
{
|
||||
//Text = "MultiMediaCard";
|
||||
|
||||
if(cid != null)
|
||||
CidText = Decoders.MMC.Decoders.PrettifyCID(cid);
|
||||
|
||||
if(csd != null)
|
||||
CsdText = Decoders.MMC.Decoders.PrettifyCSD(csd);
|
||||
|
||||
if(ocr != null)
|
||||
OcrText = Decoders.MMC.Decoders.PrettifyOCR(ocr);
|
||||
|
||||
if(extendedCsd != null)
|
||||
ExtendedCsdText = Decoders.MMC.Decoders.PrettifyExtendedCSD(extendedCsd);
|
||||
}
|
||||
|
||||
break;
|
||||
case DeviceType.SecureDigital:
|
||||
{
|
||||
//Text = "SecureDigital";
|
||||
|
||||
if(cid != null)
|
||||
CidText = Decoders.SecureDigital.Decoders.PrettifyCID(cid);
|
||||
|
||||
if(csd != null)
|
||||
CsdText = Decoders.SecureDigital.Decoders.PrettifyCSD(csd);
|
||||
|
||||
if(ocr != null)
|
||||
OcrText = Decoders.SecureDigital.Decoders.PrettifyOCR(ocr);
|
||||
|
||||
if(scr != null)
|
||||
ScrText = Decoders.SecureDigital.Decoders.PrettifySCR(scr);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public string CidText { get; }
|
||||
public string CsdText { get; }
|
||||
public string OcrText { get; }
|
||||
public string ExtendedCsdText { get; }
|
||||
public string ScrText { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user