mirror of
https://github.com/aaru-dps/Aaru.Decoders.git
synced 2025-12-16 19:24:32 +00:00
Pass string interpolation.
This commit is contained in:
@@ -306,7 +306,7 @@ public static class CIS
|
||||
sb.AppendLine("\t" + Localization.Additional_information);
|
||||
|
||||
foreach(string info in tuple.AdditionalInformation.Where(info => !string.IsNullOrEmpty(info)))
|
||||
sb.AppendFormat("\t\t{0}", info).AppendLine();
|
||||
sb.Append($"\t\t{info}").AppendLine();
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
|
||||
12
SCSI/EVPD.cs
12
SCSI/EVPD.cs
@@ -202,7 +202,7 @@ public static class EVPD
|
||||
var sb = new StringBuilder();
|
||||
|
||||
foreach(byte b in element)
|
||||
sb.AppendFormat("{0:X2}", b);
|
||||
sb.Append($"{b:X2}");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -573,7 +573,7 @@ public static class EVPD
|
||||
sb.AppendFormat("\t" + Localization.IEEE_EUI_64_0_X2, descriptor.Binary[0]);
|
||||
|
||||
for(var i = 1; i < descriptor.Binary.Length; i++)
|
||||
sb.AppendFormat(":{0:X2}", descriptor.Binary[i]);
|
||||
sb.Append($":{descriptor.Binary[i]:X2}");
|
||||
|
||||
sb.AppendLine();
|
||||
}
|
||||
@@ -587,7 +587,7 @@ public static class EVPD
|
||||
sb.AppendFormat("\t" + Localization.NAA_0_X2, descriptor.Binary[0]);
|
||||
|
||||
for(var i = 1; i < descriptor.Binary.Length; i++)
|
||||
sb.AppendFormat(":{0:X2}", descriptor.Binary[i]);
|
||||
sb.Append($":{descriptor.Binary[i]:X2}");
|
||||
|
||||
sb.AppendLine();
|
||||
}
|
||||
@@ -640,7 +640,7 @@ public static class EVPD
|
||||
sb.AppendFormat("\t" + Localization.MD5_logical_unit_identifier_0_x2, descriptor.Binary[0]);
|
||||
|
||||
for(var i = 1; i < descriptor.Binary.Length; i++)
|
||||
sb.AppendFormat("{0:x2}", descriptor.Binary[i]);
|
||||
sb.Append($"{descriptor.Binary[i]:x2}");
|
||||
|
||||
sb.AppendLine();
|
||||
}
|
||||
@@ -909,7 +909,7 @@ public static class EVPD
|
||||
sb.AppendFormat("\t" + "{0:X2}", identifier.Identifier[0]);
|
||||
|
||||
for(var i = 1; i < identifier.Identifier.Length; i++)
|
||||
sb.AppendFormat(":{0:X2}", identifier.Identifier[i]);
|
||||
sb.Append($":{identifier.Identifier[i]:X2}");
|
||||
|
||||
sb.AppendLine();
|
||||
}
|
||||
@@ -1481,7 +1481,7 @@ public static class EVPD
|
||||
if(id != null)
|
||||
{
|
||||
sb.AppendLine("\t" + Localization.ATA_IDENTIFY_information_follows);
|
||||
sb.AppendFormat("{0}", ATA.Identify.Prettify(id)).AppendLine();
|
||||
sb.Append($"{ATA.Identify.Prettify(id)}").AppendLine();
|
||||
}
|
||||
else
|
||||
sb.AppendLine("\t" + Localization.Could_not_decode_ATA_IDENTIFY_information);
|
||||
|
||||
@@ -222,7 +222,7 @@ public static class DensitySupport
|
||||
sb.AppendFormat("\t" + Localization.Medium_supports_following_density_codes);
|
||||
|
||||
for(var i = 0; i < descriptor.numberOfCodes; i++)
|
||||
sb.AppendFormat(" {0:X2}h", descriptor.densityCodes[i]);
|
||||
sb.Append($" {descriptor.densityCodes[i]:X2}h");
|
||||
|
||||
sb.AppendLine();
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public static class Saturn
|
||||
IPBinInformation.AppendFormat(Localization.Product_name_0, Encoding.ASCII.GetString(ipbin.product_name)).
|
||||
AppendLine();
|
||||
|
||||
IPBinInformation.AppendFormat("Product number: {0}", Encoding.ASCII.GetString(ipbin.product_no)).AppendLine();
|
||||
IPBinInformation.Append($"Product number: {Encoding.ASCII.GetString(ipbin.product_no)}").AppendLine();
|
||||
|
||||
IPBinInformation.AppendFormat(Localization.Product_version_0, Encoding.ASCII.GetString(ipbin.product_version)).
|
||||
AppendLine();
|
||||
|
||||
28
Xbox/DMI.cs
28
Xbox/DMI.cs
@@ -147,15 +147,15 @@ public static class DMI
|
||||
sb.Append(Localization.Catalogue_number);
|
||||
|
||||
for(var i = 0; i < 2; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append($"{decoded.CatalogNumber[i]}");
|
||||
|
||||
sb.Append("-");
|
||||
|
||||
for(var i = 2; i < 7; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append($"{decoded.CatalogNumber[i]}");
|
||||
|
||||
sb.Append("-");
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[7]);
|
||||
sb.Append($"{decoded.CatalogNumber[7]}");
|
||||
sb.AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization.Timestamp_0, DateTime.FromFileTimeUtc(decoded.Timestamp)).AppendLine();
|
||||
@@ -174,17 +174,17 @@ public static class DMI
|
||||
sb.Append(Localization.Catalogue_number);
|
||||
|
||||
for(var i = 0; i < 2; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append($"{decoded.CatalogNumber[i]}");
|
||||
|
||||
sb.Append("-");
|
||||
|
||||
for(var i = 2; i < 6; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append($"{decoded.CatalogNumber[i]}");
|
||||
|
||||
sb.Append("-");
|
||||
|
||||
for(var i = 6; i < 8; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append($"{decoded.CatalogNumber[i]}");
|
||||
|
||||
sb.Append("-");
|
||||
|
||||
@@ -192,32 +192,32 @@ public static class DMI
|
||||
{
|
||||
case 13:
|
||||
for(var i = 8; i < 10; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append($"{decoded.CatalogNumber[i]}");
|
||||
|
||||
sb.Append("-");
|
||||
|
||||
for(var i = 10; i < 13; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append($"{decoded.CatalogNumber[i]}");
|
||||
|
||||
break;
|
||||
case 14:
|
||||
for(var i = 8; i < 11; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append($"{decoded.CatalogNumber[i]}");
|
||||
|
||||
sb.Append("-");
|
||||
|
||||
for(var i = 11; i < 14; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append($"{decoded.CatalogNumber[i]}");
|
||||
|
||||
break;
|
||||
default:
|
||||
for(var i = 8; i < decoded.CatalogNumber.Length - 3; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append($"{decoded.CatalogNumber[i]}");
|
||||
|
||||
sb.Append("-");
|
||||
|
||||
for(int i = decoded.CatalogNumber.Length - 3; i < decoded.CatalogNumber.Length; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append($"{decoded.CatalogNumber[i]}");
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -227,12 +227,12 @@ public static class DMI
|
||||
sb.Append(Localization.Media_ID);
|
||||
|
||||
for(var i = 0; i < 12; i++)
|
||||
sb.AppendFormat("{0:X2}", decoded.MediaID[i]);
|
||||
sb.Append($"{decoded.MediaID[i]:X2}");
|
||||
|
||||
sb.Append("-");
|
||||
|
||||
for(var i = 12; i < 16; i++)
|
||||
sb.AppendFormat("{0:X2}", decoded.MediaID[i]);
|
||||
sb.Append($"{decoded.MediaID[i]:X2}");
|
||||
|
||||
sb.AppendLine();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user