Merge pull request #1518 from TASVideos/interp_discohawk

Use string interpolation in BizHawk.Client.DiscoHawk
This commit is contained in:
adelikat 2019-03-27 19:11:21 -05:00 committed by GitHub
commit ecec7807f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -14,7 +14,7 @@ namespace BizHawk.Client.DiscoHawk
public About() public About()
{ {
InitializeComponent(); InitializeComponent();
lblVersion.Text = "v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); lblVersion.Text = $"v{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}";
} }
private void richTextBox1_LinkClicked(object sender, LinkClickedEventArgs e) private void richTextBox1_LinkClicked(object sender, LinkClickedEventArgs e)

View File

@ -31,7 +31,7 @@ namespace BizHawk.Client.DiscoHawk
for (int sector = 0; sector < trackLength; sector++) for (int sector = 0; sector < trackLength; sector++)
dsr.ReadLBA_2352(startLba + sector, waveData, sector * 2352); dsr.ReadLBA_2352(startLba + sector, waveData, sector * 2352);
string mp3Path = string.Format("{0} - Track {1:D2}.mp3", Path.Combine(path, filebase), track.Number); string mp3Path = $"{Path.Combine(path, filebase)} - Track {track.Number:D2}.mp3";
if (File.Exists(mp3Path)) if (File.Exists(mp3Path))
{ {
if (!confirmed) if (!confirmed)

View File

@ -102,7 +102,7 @@ namespace BizHawk.Client.DiscoHawk
return asm; return asm;
//load missing assemblies by trying to find them in the dll directory //load missing assemblies by trying to find them in the dll directory
string dllname = new AssemblyName(args.Name).Name + ".dll"; string dllname = $"{new AssemblyName(args.Name).Name}.dll";
string directory = Path.Combine(GetExeDirectoryAbsolute(), "dll"); string directory = Path.Combine(GetExeDirectoryAbsolute(), "dll");
string fname = Path.Combine(directory, dllname); string fname = Path.Combine(directory, dllname);
if (!File.Exists(fname)) return null; if (!File.Exists(fname)) return null;
@ -120,7 +120,7 @@ namespace BizHawk.Client.DiscoHawk
static extern bool DeleteFileW([MarshalAs(UnmanagedType.LPWStr)]string lpFileName); static extern bool DeleteFileW([MarshalAs(UnmanagedType.LPWStr)]string lpFileName);
static void RemoveMOTW(string path) static void RemoveMOTW(string path)
{ {
DeleteFileW(path + ":Zone.Identifier"); DeleteFileW($"{path}:Zone.Identifier");
} }
static void WhackAllMOTW(string dllDir) static void WhackAllMOTW(string dllDir)
@ -416,8 +416,8 @@ namespace BizHawk.Client.DiscoHawk
sw.Write(" "); sw.Write(" ");
sw.Write(new string('-', count * 4)); sw.Write(new string('-', count * 4));
sw.WriteLine(); sw.WriteLine();
sw_dump_chunk_one(string.Format("SRC #{0,6} ({1})", lba, new Timestamp(lba)), lba, src_databuf, addr, count); sw_dump_chunk_one($"SRC #{lba,6} ({new Timestamp(lba)})", lba, src_databuf, addr, count);
sw_dump_chunk_one(string.Format("DST #{0,6} ({1})", lba, new Timestamp(lba)), lba, dst_databuf, addr, count); sw_dump_chunk_one($"DST #{lba,6} ({new Timestamp(lba)})", lba, dst_databuf, addr, count);
}; };
//verify each sector contents //verify each sector contents

View File

@ -58,7 +58,7 @@ namespace BizHawk.Client.DiscoHawk
string baseName = Path.GetFileNameWithoutExtension(file); string baseName = Path.GetFileNameWithoutExtension(file);
baseName += "_hawked"; baseName += "_hawked";
string outfile = Path.Combine(Path.GetDirectoryName(file), baseName) + ".ccd"; string outfile = $"{Path.Combine(Path.GetDirectoryName(file), baseName)}.ccd";
CCD_Format.Dump(disc, outfile); CCD_Format.Dump(disc, outfile);
} }
this.Cursor = Cursors.Default; this.Cursor = Cursors.Default;