Files
Aaru/DiscImageChef.Gui/Tabs/tabSdMmcInfo.xeto.cs

131 lines
4.5 KiB
C#
Raw Normal View History

// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
2018-12-29 15:26:00 +00:00
// Filename : tabSdMmcInfo.xeto.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Device information.
//
// --[ Description ] ----------------------------------------------------------
//
2018-12-29 15:26:00 +00:00
// Implements the SecureDigital/MultiMediaCard device information.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General public License for more details.
//
// You should have received a copy of the GNU General public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
2018-12-29 17:34:38 +00:00
// Copyright © 2011-2019 Natalia Portillo
// ****************************************************************************/
2018-11-27 00:09:53 +00:00
using DiscImageChef.CommonTypes.Enums;
using Eto.Forms;
using Eto.Serialization.Xaml;
namespace DiscImageChef.Gui.Tabs
{
public class tabSdMmcInfo : TabPage
{
public tabSdMmcInfo()
{
XamlReader.Load(this);
}
internal void LoadData(DeviceType deviceType, byte[] cid, byte[] csd, byte[] ocr, byte[] extendedCsd,
byte[] scr)
{
switch(deviceType)
{
case DeviceType.MMC:
{
Text = "MultiMediaCard";
if(cid != null)
{
tabCid.Visible = true;
txtCid.Text = Decoders.MMC.Decoders.PrettifyCID(cid);
}
if(csd != null)
{
tabCsd.Visible = true;
txtCid.Text = Decoders.MMC.Decoders.PrettifyCSD(csd);
}
if(ocr != null)
{
tabOcr.Visible = true;
txtCid.Text = Decoders.MMC.Decoders.PrettifyOCR(ocr);
}
if(extendedCsd != null)
{
tabExtendedCsd.Visible = true;
txtCid.Text = Decoders.MMC.Decoders.PrettifyExtendedCSD(extendedCsd);
}
}
break;
case DeviceType.SecureDigital:
{
Text = "SecureDigital";
if(cid != null)
{
tabCid.Visible = true;
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyCID(cid);
}
if(csd != null)
{
tabCsd.Visible = true;
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyCSD(csd);
}
if(ocr != null)
{
tabOcr.Visible = true;
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyOCR(ocr);
}
if(scr != null)
{
tabScr.Visible = true;
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifySCR(scr);
}
}
break;
}
Visible = tabCid.Visible || tabCsd.Visible || tabOcr.Visible || tabExtendedCsd.Visible || tabScr.Visible;
}
#region XAML controls
#pragma warning disable 169
#pragma warning disable 649
TabPage tabCid;
TextArea txtCid;
TabPage tabCsd;
TextArea txtCsd;
TabPage tabOcr;
TextArea txtOcr;
TabPage tabExtendedCsd;
TextArea txtExtendedCsd;
TabPage tabScr;
TextArea txtScr;
#pragma warning restore 169
#pragma warning restore 649
#endregion
}
}