REFACTOR: Use preferred braces style.

This commit is contained in:
2017-12-20 23:07:46 +00:00
parent 4158d64854
commit e9443388ee
120 changed files with 1016 additions and 1975 deletions

View File

@@ -54,19 +54,25 @@ namespace DiscImageChef.Server
// Strip non-ascii, strip slashes and question marks
if(manufacturer != null)
{
manufacturer = Encoding
.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII,
Encoding.UTF8.GetBytes(manufacturer))).Replace('/', '_')
.Replace('\\', '_').Replace('?', '_');
}
if(model != null)
{
model = Encoding
.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII, Encoding.UTF8.GetBytes(model)))
.Replace('/', '_').Replace('\\', '_').Replace('?', '_');
}
if(revision != null)
{
revision = Encoding
.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII,
Encoding.UTF8.GetBytes(revision))).Replace('/', '_')
.Replace('\\', '_').Replace('?', '_');
}
string xmlFile = null;
if(!string.IsNullOrWhiteSpace(manufacturer) && !string.IsNullOrWhiteSpace(model) &&
@@ -107,12 +113,16 @@ namespace DiscImageChef.Server
lblUsbProduct.Text = HttpUtility.HtmlEncode(report.USB.Product);
lblUsbVendor.Text = string.Format("0x{0:x4}", report.USB.VendorID);
if(usbVendorDescription != null)
{
lblUsbVendorDescription.Text =
string.Format("({0})", HttpUtility.HtmlEncode(usbVendorDescription));
}
lblUsbProductId.Text = string.Format("0x{0:x4}", report.USB.ProductID);
if(usbProductDescription != null)
{
lblUsbProductDescription.Text =
string.Format("({0})", HttpUtility.HtmlEncode(usbProductDescription));
}
}
else divUsb.Visible = false;
@@ -273,9 +283,11 @@ namespace DiscImageChef.Server
if(VendorString.Prettify(report.SCSI.Inquiry.VendorIdentification) !=
report.SCSI.Inquiry.VendorIdentification)
{
lblScsiVendor.Text = string.Format("{0} ({1})", report.SCSI.Inquiry.VendorIdentification,
VendorString.Prettify(report.SCSI.Inquiry
.VendorIdentification));
}
else lblScsiVendor.Text = report.SCSI.Inquiry.VendorIdentification;
lblScsiProduct.Text = report.SCSI.Inquiry.ProductIdentification;
lblScsiRevision.Text = report.SCSI.Inquiry.ProductRevisionLevel;
@@ -287,8 +299,10 @@ namespace DiscImageChef.Server
if(report.SCSI.SupportsModeSubpages) scsiOneValue.Add("Device supports MODE SENSE subpages");
if(report.SCSI.ModeSense != null)
{
ScsiModeSense.Report(report.SCSI.ModeSense, report.SCSI.Inquiry.VendorIdentification,
report.SCSI.Inquiry.PeripheralDeviceType, ref scsiOneValue, ref modePages);
}
if(modePages.Count > 0)
{
@@ -436,16 +450,22 @@ namespace DiscImageChef.Server
}
if(report.SCSI.ReadCapabilities.MediumTypeSpecified)
{
scsiOneValue.Add(string.Format("Medium type code: {0:X2}h",
report.SCSI.ReadCapabilities.MediumType));
}
if(report.SCSI.ReadCapabilities.DensitySpecified)
{
scsiOneValue.Add(string.Format("Density code: {0:X2}h",
report.SCSI.ReadCapabilities.Density));
}
if((report.SCSI.ReadCapabilities.SupportsReadLong ||
report.SCSI.ReadCapabilities.SupportsReadLong16) &&
report.SCSI.ReadCapabilities.LongBlockSizeSpecified)
{
scsiOneValue.Add(string.Format("Long block size: {0} bytes",
report.SCSI.ReadCapabilities.LongBlockSize));
}
if(report.SCSI.ReadCapabilities.SupportsReadCapacity)
scsiOneValue.Add("Device supports READ CAPACITY (10) command.");
if(report.SCSI.ReadCapabilities.SupportsReadCapacity16)