diff --git a/BizHawk.Client.ApiHawk/Attributes/BizHawkExternalToolAttribute.cs b/BizHawk.Client.ApiHawk/Attributes/BizHawkExternalToolAttribute.cs index 260eaf71c7..590eba9f91 100644 --- a/BizHawk.Client.ApiHawk/Attributes/BizHawkExternalToolAttribute.cs +++ b/BizHawk.Client.ApiHawk/Attributes/BizHawkExternalToolAttribute.cs @@ -38,7 +38,7 @@ namespace BizHawk.Client.ApiHawk /// Tool's name /// Small description about the tool itself public BizHawkExternalToolAttribute(string name, string description) - : this(name, description, string.Empty) + : this(name, description, "") { } /// @@ -46,7 +46,7 @@ namespace BizHawk.Client.ApiHawk /// /// Tool's name public BizHawkExternalToolAttribute(string name) - :this(name, string.Empty, string.Empty) + :this(name, "", "") {} #endregion diff --git a/BizHawk.Client.ApiHawk/Attributes/BizHawkExternalToolUsageAttribute.cs b/BizHawk.Client.ApiHawk/Attributes/BizHawkExternalToolUsageAttribute.cs index 66737e038c..5e7dc81d3c 100644 --- a/BizHawk.Client.ApiHawk/Attributes/BizHawkExternalToolUsageAttribute.cs +++ b/BizHawk.Client.ApiHawk/Attributes/BizHawkExternalToolUsageAttribute.cs @@ -31,7 +31,7 @@ namespace BizHawk.Client.ApiHawk { throw new InvalidOperationException("A system must be set"); } - if (usage == BizHawkExternalToolUsage.GameSpecific && gameHash.Trim() == string.Empty) + if (usage == BizHawkExternalToolUsage.GameSpecific && gameHash.Trim() == "") { throw new InvalidOperationException("A game hash must be set"); } @@ -47,14 +47,14 @@ namespace BizHawk.Client.ApiHawk /// i.e. what your external tool is for /// that your external tool is used for public BizHawkExternalToolUsageAttribute(BizHawkExternalToolUsage usage, CoreSystem system) - :this(usage, system, string.Empty) + :this(usage, system, "") {} /// /// Initialize a new instance of /// public BizHawkExternalToolUsageAttribute() - :this(BizHawkExternalToolUsage.Global, CoreSystem.Null, string.Empty) + :this(BizHawkExternalToolUsage.Global, CoreSystem.Null, "") { } diff --git a/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs b/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs index 7dada85b17..54a9ccfa37 100644 --- a/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs +++ b/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs @@ -92,7 +92,7 @@ namespace BizHawk.Client.ApiHawk BizHawkExternalToolAttribute attribute = (BizHawkExternalToolAttribute)attributes[0]; item = new ToolStripMenuItem(attribute.Name); item.ToolTipText = attribute.Description; - if (attribute.IconResourceName != string.Empty) + if (attribute.IconResourceName != "") { Stream s = externalToolFile.GetManifestResourceStream(string.Format("{0}.{1}", externalToolFile.GetName().Name, attribute.IconResourceName)); if (s != null) diff --git a/BizHawk.Client.Common/7z/StreamWrappers.cs b/BizHawk.Client.Common/7z/StreamWrappers.cs index 55821d3e17..36a60fac98 100644 --- a/BizHawk.Client.Common/7z/StreamWrappers.cs +++ b/BizHawk.Client.Common/7z/StreamWrappers.cs @@ -330,7 +330,7 @@ namespace SevenZip { return "." + num.ToString(CultureInfo.InvariantCulture); } - return String.Empty; + return ""; } private int StreamNumberByOffset(long offset) diff --git a/BizHawk.Client.Common/CoreFileProvider.cs b/BizHawk.Client.Common/CoreFileProvider.cs index 44b7993b37..401db2c33b 100644 --- a/BizHawk.Client.Common/CoreFileProvider.cs +++ b/BizHawk.Client.Common/CoreFileProvider.cs @@ -19,7 +19,7 @@ namespace BizHawk.Client.Common public string PathSubfile(string fname) { - return Path.Combine(SubfileDirectory ?? string.Empty, fname); + return Path.Combine(SubfileDirectory ?? "", fname); } public string DllPath() diff --git a/BizHawk.Client.Common/NESGameGenieEncoderDecoder.cs b/BizHawk.Client.Common/NESGameGenieEncoderDecoder.cs index 2ea1c02854..f986effd6a 100644 --- a/BizHawk.Client.Common/NESGameGenieEncoderDecoder.cs +++ b/BizHawk.Client.Common/NESGameGenieEncoderDecoder.cs @@ -4,7 +4,7 @@ namespace BizHawk.Client.Common { public class NESGameGenieDecoder { - private readonly string _code = string.Empty; + private readonly string _code = ""; private readonly Dictionary _gameGenieTable = new Dictionary { @@ -134,7 +134,7 @@ namespace BizHawk.Client.Common _value = value; _compare = compare; - GameGenieCode = string.Empty; + GameGenieCode = ""; } public string GameGenieCode { get; private set; } diff --git a/BizHawk.Client.Common/PathManager.cs b/BizHawk.Client.Common/PathManager.cs index 1dcef23ed4..fa6475fe67 100644 --- a/BizHawk.Client.Common/PathManager.cs +++ b/BizHawk.Client.Common/PathManager.cs @@ -183,7 +183,7 @@ namespace BizHawk.Client.Common // Return drive letter only, working path must be absolute? } - return string.Empty; + return ""; } return path; @@ -248,7 +248,7 @@ namespace BizHawk.Client.Common { var newStr = name; var chars = Path.GetInvalidFileNameChars(); - return chars.Aggregate(newStr, (current, c) => current.Replace(c.ToString(), string.Empty)); + return chars.Aggregate(newStr, (current, c) => current.Replace(c.ToString(), "")); } public static string FilesystemSafeName(GameInfo game) @@ -256,7 +256,7 @@ namespace BizHawk.Client.Common var filesystemSafeName = game.Name .Replace("|", "+") .Replace(":", " -") // adelikat - Path.GetFileName scraps everything to the left of a colon unfortunately, so we need this hack here - .Replace("\"", string.Empty); // adelikat - Ivan Ironman Stewart's Super Off-Road has quotes in game name + .Replace("\"", ""); // adelikat - Ivan Ironman Stewart's Super Off-Road has quotes in game name // zero 06-nov-2015 - regarding the below, i changed my mind. for libretro i want subdirectories here. var filesystemDir = Path.GetDirectoryName(filesystemSafeName); @@ -297,7 +297,7 @@ namespace BizHawk.Client.Common // hijinx here to get the core name out of the game name var name = FilesystemSafeName(game); name = Path.GetDirectoryName(name); - if (name == string.Empty) + if (name == "") { name = FilesystemSafeName(game); } @@ -318,7 +318,7 @@ namespace BizHawk.Client.Common // hijinx here to get the core name out of the game name var name = FilesystemSafeName(game); name = Path.GetDirectoryName(name); - if (name == string.Empty) + if (name == "") { name = FilesystemSafeName(game); } diff --git a/BizHawk.Client.Common/RecentFiles.cs b/BizHawk.Client.Common/RecentFiles.cs index ce2454810d..2a5449669f 100644 --- a/BizHawk.Client.Common/RecentFiles.cs +++ b/BizHawk.Client.Common/RecentFiles.cs @@ -37,7 +37,7 @@ namespace BizHawk.Client.Common public int Count => recentlist.Count; [JsonIgnore] - public string MostRecent => recentlist.Any() ? recentlist[0] : string.Empty; + public string MostRecent => recentlist.Any() ? recentlist[0] : ""; public string this[int index] { @@ -48,7 +48,7 @@ namespace BizHawk.Client.Common return recentlist[index]; } - return string.Empty; + return ""; } } diff --git a/BizHawk.Client.Common/RomLoader.cs b/BizHawk.Client.Common/RomLoader.cs index 91007b5cb6..343ae5d08d 100644 --- a/BizHawk.Client.Common/RomLoader.cs +++ b/BizHawk.Client.Common/RomLoader.cs @@ -196,7 +196,7 @@ namespace BizHawk.Client.Common { if (recursiveCount > 1) // hack to stop recursive calls from endlessly rerunning if we can't load it { - DoLoadErrorCallback("Failed multiple attempts to load ROM.", string.Empty); + DoLoadErrorCallback("Failed multiple attempts to load ROM.", ""); return false; } @@ -364,7 +364,7 @@ namespace BizHawk.Client.Common if (discMountJob.OUT_SlowLoadAborted) { - DoLoadErrorCallback("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk", string.Empty, LoadErrorType.DiscError); + DoLoadErrorCallback("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk", "", LoadErrorType.DiscError); return false; } @@ -432,7 +432,7 @@ namespace BizHawk.Client.Common if (discMountJob.OUT_SlowLoadAborted) { - DoLoadErrorCallback("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk", string.Empty, LoadErrorType.DiscError); + DoLoadErrorCallback("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk", "", LoadErrorType.DiscError); return false; } @@ -654,7 +654,7 @@ namespace BizHawk.Client.Common { // need to get rid of this hack at some point rom = new RomGame(file); - ((CoreFileProvider)nextComm.CoreFileProvider).SubfileDirectory = Path.GetDirectoryName(path.Replace("|", string.Empty)); // Dirty hack to get around archive filenames (since we are just getting the directory path, it is safe to mangle the filename + ((CoreFileProvider)nextComm.CoreFileProvider).SubfileDirectory = Path.GetDirectoryName(path.Replace("|", "")); // Dirty hack to get around archive filenames (since we are just getting the directory path, it is safe to mangle the filename byte[] romData = null; byte[] xmlData = rom.FileData; @@ -769,7 +769,7 @@ namespace BizHawk.Client.Common else { // need to get rid of this hack at some point - ((CoreFileProvider)nextComm.CoreFileProvider).SubfileDirectory = Path.GetDirectoryName(path.Replace("|", String.Empty)); // Dirty hack to get around archive filenames (since we are just getting the directory path, it is safe to mangle the filename + ((CoreFileProvider)nextComm.CoreFileProvider).SubfileDirectory = Path.GetDirectoryName(path.Replace("|", "")); // Dirty hack to get around archive filenames (since we are just getting the directory path, it is safe to mangle the filename var romData = isXml ? null : rom.FileData; var xmlData = isXml ? rom.FileData : null; var snes = new LibsnesCore(game, romData, Deterministic, xmlData, nextComm, GetCoreSettings(), GetCoreSyncSettings()); diff --git a/BizHawk.Client.Common/SavestateManager.cs b/BizHawk.Client.Common/SavestateManager.cs index 561c75606b..53b7e1329f 100644 --- a/BizHawk.Client.Common/SavestateManager.cs +++ b/BizHawk.Client.Common/SavestateManager.cs @@ -173,7 +173,7 @@ namespace BizHawk.Client.Common bl.GetLump(BinaryStateLump.Framebuffer, false, PopulateFramebuffer); - string userData = string.Empty; + string userData = ""; bl.GetLump(BinaryStateLump.UserData, false, delegate(TextReader tr) { string line; @@ -226,7 +226,7 @@ namespace BizHawk.Client.Common break; } - if (str.Trim() == string.Empty) + if (str.Trim() == "") { continue; } diff --git a/BizHawk.Client.Common/SystemInfo.cs b/BizHawk.Client.Common/SystemInfo.cs index 0462bb31fb..836d7a396a 100644 --- a/BizHawk.Client.Common/SystemInfo.cs +++ b/BizHawk.Client.Common/SystemInfo.cs @@ -126,7 +126,7 @@ namespace BizHawk.Client.Common /// /// Gets the instance for Null (i.e. nothing is emulated) emulator /// - public static SystemInfo Null { get; } = new SystemInfo(string.Empty, CoreSystem.Null, 0); + public static SystemInfo Null { get; } = new SystemInfo("", CoreSystem.Null, 0); /// /// Gets the instance for PCEngine (TurboGrafx-16) diff --git a/BizHawk.Client.Common/XmlGame.cs b/BizHawk.Client.Common/XmlGame.cs index 39a2fd60e8..c896f7e1c5 100644 --- a/BizHawk.Client.Common/XmlGame.cs +++ b/BizHawk.Client.Common/XmlGame.cs @@ -47,7 +47,7 @@ namespace BizHawk.Client.Common }, Xml = x }; - string fullpath = string.Empty; + string fullpath = ""; var n = y.SelectSingleNode("./LoadAssets"); if (n != null) @@ -82,7 +82,7 @@ namespace BizHawk.Client.Common else { // relative path - fullpath = Path.GetDirectoryName(f.CanonicalFullPath.Split('|').First()) ?? string.Empty; + fullpath = Path.GetDirectoryName(f.CanonicalFullPath.Split('|').First()) ?? ""; fullpath = Path.Combine(fullpath, filename.Split('|').First()); try { diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index 6138918fc8..ddb69c9863 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -42,10 +42,10 @@ namespace BizHawk.Client.Common // Core preference for generic file extension, key: file extension, value: a systemID or empty if no preference public Dictionary PreferredPlatformsForExtensions = new Dictionary { - { ".bin", string.Empty }, - { ".rom", string.Empty }, - { ".iso", string.Empty }, - { ".img", string.Empty }, + { ".bin", "" }, + { ".rom", "" }, + { ".iso", "" }, + { ".img", "" }, }; // Path Settings ************************************/ @@ -88,7 +88,7 @@ namespace BizHawk.Client.Common public int TargetScanlineFilterIntensity = 128; // choose between 0 and 256 public int TargetDisplayFilter = 0; public int DispFinalFilter = 0; // None - public string DispUserFilterPath = string.Empty; + public string DispUserFilterPath = ""; public RecentFiles RecentRoms = new RecentFiles(10); public RecentFiles RecentRomSessions = new RecentFiles(8); // Only used for MultiHawk public bool PauseWhenMenuActivated = true; @@ -129,8 +129,8 @@ namespace BizHawk.Client.Common public bool FirstBoot = true; public bool Update_AutoCheckEnabled = false; public DateTime? Update_LastCheckTimeUTC = null; - public string Update_LatestVersion = string.Empty; - public string Update_IgnoreVersion = string.Empty; + public string Update_LatestVersion = ""; + public string Update_IgnoreVersion = ""; public bool CDLAutoSave = true, CDLAutoStart = true; ////public bool TurboSeek = true; // When PauseOnFrame is set, this will decide whether the client goes into turbo mode or not @@ -357,7 +357,7 @@ namespace BizHawk.Client.Common public int SoundVolume = 100; // Range 0-100 public int SoundVolumeRWFF = 50; // Range 0-100 public bool SoundThrottle = false; - public string SoundDevice = string.Empty; + public string SoundDevice = ""; public int SoundBufferSizeMs = 100; // Log Window @@ -390,12 +390,12 @@ namespace BizHawk.Client.Common public Color HexHighlightFreezeColor = Color.Violet; // Video dumping settings - public string VideoWriter = string.Empty; + public string VideoWriter = ""; public int JMDCompression = 3; public int JMDThreads = 3; - public string FFmpegFormat = string.Empty; + public string FFmpegFormat = ""; public string FFmpegCustomCommand = "-c:a foo -c:v bar -f baz"; - public string AVICodecToken = string.Empty; + public string AVICodecToken = ""; public int GifWriterFrameskip = 3; public int GifWriterDelay = -1; diff --git a/BizHawk.Client.Common/config/PathEntry.cs b/BizHawk.Client.Common/config/PathEntry.cs index 34a9cbf902..434644d1d8 100644 --- a/BizHawk.Client.Common/config/PathEntry.cs +++ b/BizHawk.Client.Common/config/PathEntry.cs @@ -177,10 +177,10 @@ namespace BizHawk.Client.Common new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "Tools", Path = Path.Combine(".", "Tools"), Ordinal = 7 }, new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "Lua", Path = Path.Combine(".", "Lua"), Ordinal = 8 }, new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "Watch (.wch)", Path = Path.Combine(".", "."), Ordinal = 9 }, - new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "Debug Logs", Path = Path.Combine(".", string.Empty), Ordinal = 10 }, + new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "Debug Logs", Path = Path.Combine(".", ""), Ordinal = 10 }, new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "Macros", Path = Path.Combine(".", "Movies", "Macros"), Ordinal = 11 }, new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "TAStudio states", Path = Path.Combine(".", "Movies", "TAStudio states"), Ordinal = 12 }, - new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "Multi-Disk Bundles", Path = Path.Combine(".", string.Empty), Ordinal = 13 }, + new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "Multi-Disk Bundles", Path = Path.Combine(".", ""), Ordinal = 13 }, new PathEntry { System = "Global_NULL", SystemDisplayName = "Global", Type = "External Tools", Path = Path.Combine(".", "ExternalTools"), Ordinal = 14 }, new PathEntry { System = "INTV", SystemDisplayName = "Intellivision", Type = "Base", Path = Path.Combine(".", "Intellivision"), Ordinal = 0 }, diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs index 2f15a13d67..3edc77cd9f 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Emu.cs @@ -340,7 +340,7 @@ namespace BizHawk.Client.Common return RegionableCore.Region.ToString(); } - return string.Empty; + return ""; } } } diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs index bd009b9d06..c1e2ef60ab 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.GameInfo.cs @@ -27,10 +27,10 @@ namespace BizHawk.Client.Common { if (Global.Game != null) { - return Global.Game.Name ?? string.Empty; + return Global.Game.Name ?? ""; } - return string.Empty; + return ""; } [LuaMethodAttributes( @@ -39,10 +39,10 @@ namespace BizHawk.Client.Common { if (Global.Game != null) { - return Global.Game.Hash ?? string.Empty; + return Global.Game.Hash ?? ""; } - return string.Empty; + return ""; } [LuaMethodAttributes( @@ -66,7 +66,7 @@ namespace BizHawk.Client.Common return Global.Game.Status.ToString(); } - return string.Empty; + return ""; } [LuaMethodAttributes( @@ -85,7 +85,7 @@ namespace BizHawk.Client.Common "getboardtype", "returns identifying information about the 'mapper' or similar capability used for this game. empty if no such useful distinction can be drawn")] public string GetBoardType() { - return BoardInfo?.BoardName ?? string.Empty; + return BoardInfo?.BoardName ?? ""; } [LuaMethodAttributes( diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs index adfd01ac37..ef5419f0e7 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.Movie.cs @@ -84,7 +84,7 @@ namespace BizHawk.Client.Common return lg.GenerateLogEntry(); } - return string.Empty; + return ""; } [LuaMethodAttributes( diff --git a/BizHawk.Client.Common/lua/LuaDocumentation.cs b/BizHawk.Client.Common/lua/LuaDocumentation.cs index 0861048fcf..9849a1cb3b 100644 --- a/BizHawk.Client.Common/lua/LuaDocumentation.cs +++ b/BizHawk.Client.Common/lua/LuaDocumentation.cs @@ -158,7 +158,7 @@ __Types and notation__ public string ToNotepadPlusPlusAutoComplete() { - return string.Empty; // TODO + return ""; // TODO } } @@ -228,10 +228,10 @@ __Types and notation__ private string TypeCleanup(string str) { return str - .Replace("System", string.Empty) - .Replace(" ", string.Empty) - .Replace(".", string.Empty) - .Replace("LuaInterface", string.Empty) + .Replace("System", "") + .Replace(" ", "") + .Replace(".", "") + .Replace("LuaInterface", "") .Replace("Object[]", "object[] ") .Replace("Object", "object ") .Replace("Nullable`1[Boolean]", "bool? ") diff --git a/BizHawk.Client.Common/lua/LuaFile.cs b/BizHawk.Client.Common/lua/LuaFile.cs index 24f1b844c3..4481e21887 100644 --- a/BizHawk.Client.Common/lua/LuaFile.cs +++ b/BizHawk.Client.Common/lua/LuaFile.cs @@ -4,7 +4,7 @@ { public LuaFile(string path) { - Name = string.Empty; + Name = ""; Path = path; State = RunState.Running; FrameWaiting = false; @@ -23,8 +23,8 @@ public LuaFile(bool isSeparator) { IsSeparator = isSeparator; - Name = string.Empty; - Path = string.Empty; + Name = ""; + Path = ""; State = RunState.Disabled; } diff --git a/BizHawk.Client.Common/lua/LuaFileList.cs b/BizHawk.Client.Common/lua/LuaFileList.cs index 7d9a2a135d..1038efb513 100644 --- a/BizHawk.Client.Common/lua/LuaFileList.cs +++ b/BizHawk.Client.Common/lua/LuaFileList.cs @@ -7,7 +7,7 @@ namespace BizHawk.Client.Common { public class LuaFileList : List { - private string _filename = string.Empty; + private string _filename = ""; private bool _changes; public Action ChangedCallback { get; set; } @@ -39,7 +39,7 @@ namespace BizHawk.Client.Common set { - _filename = value ?? string.Empty; + _filename = value ?? ""; } } @@ -51,7 +51,7 @@ namespace BizHawk.Client.Common public new void Clear() { StopAllScripts(); - _filename = string.Empty; + _filename = ""; Changes = false; base.Clear(); } diff --git a/BizHawk.Client.Common/lua/LuaHelper.cs b/BizHawk.Client.Common/lua/LuaHelper.cs index 2301df1a62..b840690325 100644 --- a/BizHawk.Client.Common/lua/LuaHelper.cs +++ b/BizHawk.Client.Common/lua/LuaHelper.cs @@ -15,7 +15,7 @@ namespace BizHawk.Client.Common { if (method.IsPublic) { - table[method.Name] = lua.RegisterFunction(string.Empty, obj, method); + table[method.Name] = lua.RegisterFunction("", obj, method); } } diff --git a/BizHawk.Client.Common/movie/MovieService.cs b/BizHawk.Client.Common/movie/MovieService.cs index eb35f9c52e..0989ba0f9f 100644 --- a/BizHawk.Client.Common/movie/MovieService.cs +++ b/BizHawk.Client.Common/movie/MovieService.cs @@ -60,7 +60,7 @@ namespace BizHawk.Client.Common public static bool IsValidMovieExtension(string ext) { - if (MovieExtensions.Contains(ext.ToLower().Replace(".", string.Empty))) + if (MovieExtensions.Contains(ext.ToLower().Replace(".", ""))) { return true; } diff --git a/BizHawk.Client.Common/movie/MultitrackRecording.cs b/BizHawk.Client.Common/movie/MultitrackRecording.cs index b587d1f24d..2b2de2b7aa 100644 --- a/BizHawk.Client.Common/movie/MultitrackRecording.cs +++ b/BizHawk.Client.Common/movie/MultitrackRecording.cs @@ -22,7 +22,7 @@ namespace BizHawk.Client.Common { if (!IsActive) { - return string.Empty; + return ""; } if (RecordAll) diff --git a/BizHawk.Client.Common/movie/PlatformFrameRates.cs b/BizHawk.Client.Common/movie/PlatformFrameRates.cs index ba5cbcb01a..0f429d0157 100644 --- a/BizHawk.Client.Common/movie/PlatformFrameRates.cs +++ b/BizHawk.Client.Common/movie/PlatformFrameRates.cs @@ -75,7 +75,7 @@ namespace BizHawk.Client.Common { get { - var key = systemId + (pal ? "_PAL" : string.Empty); + var key = systemId + (pal ? "_PAL" : ""); if (_rates.ContainsKey(key)) { return _rates[key]; diff --git a/BizHawk.Client.Common/movie/Subtitle.cs b/BizHawk.Client.Common/movie/Subtitle.cs index 92be032c85..f7bab1ad1d 100644 --- a/BizHawk.Client.Common/movie/Subtitle.cs +++ b/BizHawk.Client.Common/movie/Subtitle.cs @@ -6,7 +6,7 @@ namespace BizHawk.Client.Common { public Subtitle() { - Message = string.Empty; + Message = ""; X = 0; Y = 0; Duration = 120; diff --git a/BizHawk.Client.Common/movie/SubtitleList.cs b/BizHawk.Client.Common/movie/SubtitleList.cs index 1c802aa4d5..b00e59443b 100644 --- a/BizHawk.Client.Common/movie/SubtitleList.cs +++ b/BizHawk.Client.Common/movie/SubtitleList.cs @@ -38,7 +38,7 @@ namespace BizHawk.Client.Common var subparts = subtitleStr.Split(' '); // Unfortunately I made the file format space delminated so this hack is necessary to get the message - var message = string.Empty; + var message = ""; for (var i = 6; i < subparts.Length; i++) { message += subparts[i] + ' '; diff --git a/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs b/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs index c9ca237f43..702c0a3fba 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs @@ -9,7 +9,7 @@ namespace BizHawk.Client.Common { public class Bk2ControllerAdapter : IMovieController { - private readonly string _logKey = string.Empty; + private readonly string _logKey = ""; private readonly WorkingDictionary MyBoolButtons = new WorkingDictionary(); private readonly WorkingDictionary MyFloatControls = new WorkingDictionary(); @@ -161,7 +161,7 @@ namespace BizHawk.Client.Common if (!string.IsNullOrWhiteSpace(mnemonic)) { var def = Global.Emulator.ControllerDefinition; - var trimmed = mnemonic.Replace("|", string.Empty); + var trimmed = mnemonic.Replace("|", ""); var buttons = Definition.ControlsOrdered.SelectMany(x => x).ToList(); var iterator = 0; diff --git a/BizHawk.Client.Common/movie/bk2/Bk2FloatConstants.cs b/BizHawk.Client.Common/movie/bk2/Bk2FloatConstants.cs index f68201f46e..e222e58c80 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2FloatConstants.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2FloatConstants.cs @@ -9,11 +9,11 @@ namespace BizHawk.Client.Common get { var key = button - .Replace("P1 ", string.Empty) - .Replace("P2 ", string.Empty) - .Replace("P3 ", string.Empty) - .Replace("P4 ", string.Empty) - .Replace("Key ", string.Empty); + .Replace("P1 ", "") + .Replace("P2 ", "") + .Replace("P3 ", "") + .Replace("P4 ", "") + .Replace("Key ", ""); if (SystemOverrides.ContainsKey(Global.Emulator.SystemId) && SystemOverrides[Global.Emulator.SystemId].ContainsKey(key)) { diff --git a/BizHawk.Client.Common/movie/bk2/Bk2Header.cs b/BizHawk.Client.Common/movie/bk2/Bk2Header.cs index 7f015d9119..98a4f8c342 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2Header.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2Header.cs @@ -9,7 +9,7 @@ namespace BizHawk.Client.Common { get { - return this.ContainsKey(key) ? base[key] : string.Empty; + return this.ContainsKey(key) ? base[key] : ""; } set diff --git a/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs b/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs index 5bb376ac36..9bb17faaea 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs @@ -12,7 +12,7 @@ namespace BizHawk.Client.Common private readonly Bk2FloatConstants FloatLookup = new Bk2FloatConstants(); private IController _source; - private readonly string _logKey = string.Empty; + private readonly string _logKey = ""; public Bk2LogEntryGenerator(string logKey) { diff --git a/BizHawk.Client.Common/movie/bk2/Bk2MnemonicConstants.cs b/BizHawk.Client.Common/movie/bk2/Bk2MnemonicConstants.cs index 129aaeb7fb..05e5a8b66a 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2MnemonicConstants.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2MnemonicConstants.cs @@ -8,7 +8,7 @@ namespace BizHawk.Client.Common { get { - var key = button.Replace("Key ", string.Empty); + var key = button.Replace("Key ", ""); if (key.StartsWith("P") && key.Length > 1 && key[1] >= '0' && key[1] <= '9') { key = key.Substring(3); diff --git a/BizHawk.Client.Common/movie/bk2/Bk2Movie.HeaderApi.cs b/BizHawk.Client.Common/movie/bk2/Bk2Movie.HeaderApi.cs index a90a7e0f8a..e042e1bd39 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2Movie.HeaderApi.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2Movie.HeaderApi.cs @@ -6,7 +6,7 @@ namespace BizHawk.Client.Common public partial class Bk2Movie { protected readonly Bk2Header Header = new Bk2Header(); - private string _syncSettingsJson = string.Empty; + private string _syncSettingsJson = ""; public IDictionary HeaderEntries => Header; @@ -111,7 +111,7 @@ namespace BizHawk.Client.Common return Header[HeaderKeys.GAMENAME]; } - return string.Empty; + return ""; } set @@ -133,7 +133,7 @@ namespace BizHawk.Client.Common return Header[HeaderKeys.PLATFORM]; } - return string.Empty; + return ""; } set diff --git a/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs b/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs index 74eb23a73a..e816b8bf20 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs @@ -110,7 +110,7 @@ namespace BizHawk.Client.Common bl.GetLump(BinaryStateLump.Input, true, delegate(TextReader tr) { - var errorMessage = string.Empty; + var errorMessage = ""; IsCountingRerecords = false; ExtractInputLog(tr, out errorMessage); IsCountingRerecords = true; @@ -214,7 +214,7 @@ namespace BizHawk.Client.Common _log.Clear(); Subtitles.Clear(); Comments.Clear(); - _syncSettingsJson = string.Empty; + _syncSettingsJson = ""; TextSavestate = null; BinarySavestate = null; } diff --git a/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs b/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs index 571c0fa5d0..02f465ce81 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs @@ -9,7 +9,7 @@ namespace BizHawk.Client.Common public partial class Bk2Movie { protected IStringLog _log; - protected string LogKey = string.Empty; + protected string LogKey = ""; public string GetInputLog() { @@ -52,12 +52,12 @@ namespace BizHawk.Client.Common return _log[getframe]; } - return string.Empty; + return ""; } public virtual bool ExtractInputLog(TextReader reader, out string errorMessage) { - errorMessage = string.Empty; + errorMessage = ""; int? stateFrame = null; // We are in record mode so replace the movie log with the one from the savestate @@ -201,7 +201,7 @@ namespace BizHawk.Client.Common public bool CheckTimeLines(TextReader reader, out string errorMessage) { // This function will compare the movie data to the savestate movie data to see if they match - errorMessage = string.Empty; + errorMessage = ""; var newLog = new List(); var stateFrame = 0; while (true) @@ -212,7 +212,7 @@ namespace BizHawk.Client.Common break; } - if (line.Trim() == string.Empty) + if (line.Trim() == "") { continue; } diff --git a/BizHawk.Client.Common/movie/bk2/Bk2Movie.cs b/BizHawk.Client.Common/movie/bk2/Bk2Movie.cs index 23b289b8aa..1a66a2f55a 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2Movie.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2Movie.cs @@ -21,7 +21,7 @@ namespace BizHawk.Client.Common Subtitles = new SubtitleList(); Comments = new List(); - Filename = string.Empty; + Filename = ""; IsCountingRerecords = true; _mode = Moviemode.Inactive; MakeBackup = true; diff --git a/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs b/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs index c75bcda530..0cba0651b4 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmControllerAdapter.cs @@ -236,7 +236,7 @@ namespace BizHawk.Client.Common { return; } - string prefix = string.Empty; + string prefix = ""; if (ControlType != "Gameboy Controller" && ControlType != "TI83 Controller") { prefix = "P" + player + " "; diff --git a/BizHawk.Client.Common/movie/bkm/BkmHeader.cs b/BizHawk.Client.Common/movie/bkm/BkmHeader.cs index 2dd4f85957..7f92230089 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmHeader.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmHeader.cs @@ -11,9 +11,9 @@ namespace BizHawk.Client.Common Subtitles = new SubtitleList(); this[HeaderKeys.EMULATIONVERSION] = VersionInfo.GetEmuVersion(); - this[HeaderKeys.PLATFORM] = Global.Emulator != null ? Global.Emulator.SystemId : string.Empty; - this[HeaderKeys.GAMENAME] = string.Empty; - this[HeaderKeys.AUTHOR] = string.Empty; + this[HeaderKeys.PLATFORM] = Global.Emulator != null ? Global.Emulator.SystemId : ""; + this[HeaderKeys.GAMENAME] = ""; + this[HeaderKeys.AUTHOR] = ""; this[HeaderKeys.RERECORDS] = "0"; } @@ -97,7 +97,7 @@ namespace BizHawk.Client.Common return this[HeaderKeys.GAMENAME]; } - return string.Empty; + return ""; } set @@ -115,7 +115,7 @@ namespace BizHawk.Client.Common return this[HeaderKeys.PLATFORM]; } - return string.Empty; + return ""; } set @@ -128,7 +128,7 @@ namespace BizHawk.Client.Common { get { - return this.ContainsKey(key) ? base[key] : string.Empty; + return this.ContainsKey(key) ? base[key] : ""; } set diff --git a/BizHawk.Client.Common/movie/bkm/BkmLogEntryGenerator.cs b/BizHawk.Client.Common/movie/bkm/BkmLogEntryGenerator.cs index ec014f7cc7..c6d7e967cc 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmLogEntryGenerator.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmLogEntryGenerator.cs @@ -163,7 +163,7 @@ namespace BizHawk.Client.Common for (int player = 1; player <= BkmMnemonicConstants.PLAYERS[_controlType]; player++) { - var prefix = string.Empty; + var prefix = ""; if (_controlType != "Gameboy Controller" && _controlType != "TI83 Controller") { prefix = "P" + player + " "; @@ -199,7 +199,7 @@ namespace BizHawk.Client.Common { return GenerateLogEntry() .Replace(".", " ") - .Replace("|", string.Empty) + .Replace("|", "") .Replace(" 000, 000", " "); } diff --git a/BizHawk.Client.Common/movie/bkm/BkmMovie.IO.cs b/BizHawk.Client.Common/movie/bkm/BkmMovie.IO.cs index 230a41261a..27284d7e4a 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmMovie.IO.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmMovie.IO.cs @@ -77,7 +77,7 @@ namespace BizHawk.Client.Common while ((line = sr.ReadLine()) != null) { - if (line == string.Empty) + if (line == "") { continue; } diff --git a/BizHawk.Client.Common/movie/bkm/BkmMovie.InputLog.cs b/BizHawk.Client.Common/movie/bkm/BkmMovie.InputLog.cs index 5926206ce2..8e65e04539 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmMovie.InputLog.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmMovie.InputLog.cs @@ -38,12 +38,12 @@ namespace BizHawk.Client.Common return _log[frame]; } - return string.Empty; + return ""; } public bool ExtractInputLog(TextReader reader, out string errorMessage) { - errorMessage = string.Empty; + errorMessage = ""; int? stateFrame = null; // We are in record mode so replace the movie log with the one from the savestate @@ -64,7 +64,7 @@ namespace BizHawk.Client.Common break; } - if (line.Trim() == string.Empty || line == "[Input]") + if (line.Trim() == "" || line == "[Input]") { continue; } @@ -117,7 +117,7 @@ namespace BizHawk.Client.Common break; } - if (line.Trim() == string.Empty || line == "[Input]") + if (line.Trim() == "" || line == "[Input]") { continue; } @@ -196,7 +196,7 @@ namespace BizHawk.Client.Common public bool CheckTimeLines(TextReader reader, out string errorMessage) { // This function will compare the movie data to the savestate movie data to see if they match - errorMessage = string.Empty; + errorMessage = ""; var log = new List(); var stateFrame = 0; while (true) @@ -207,7 +207,7 @@ namespace BizHawk.Client.Common return false; } - if (line.Trim() == string.Empty) + if (line.Trim() == "") { continue; } diff --git a/BizHawk.Client.Common/movie/bkm/BkmMovie.cs b/BizHawk.Client.Common/movie/bkm/BkmMovie.cs index c531f2757a..f0818ae928 100644 --- a/BizHawk.Client.Common/movie/bkm/BkmMovie.cs +++ b/BizHawk.Client.Common/movie/bkm/BkmMovie.cs @@ -19,7 +19,7 @@ namespace BizHawk.Client.Common public BkmMovie() { Header = new BkmHeader { [HeaderKeys.MOVIEVERSION] = "BizHawk v0.0.1" }; - Filename = string.Empty; + Filename = ""; _preloadFramecount = 0; IsCountingRerecords = true; diff --git a/BizHawk.Client.Common/movie/import/Fm2Import.cs b/BizHawk.Client.Common/movie/import/Fm2Import.cs index bdbb2eab35..b0aca401ae 100644 --- a/BizHawk.Client.Common/movie/import/Fm2Import.cs +++ b/BizHawk.Client.Common/movie/import/Fm2Import.cs @@ -25,7 +25,7 @@ namespace BizHawk.Client.Common { lineNum++; - if (line == string.Empty) + if (line == "") { continue; } diff --git a/BizHawk.Client.Common/movie/import/MovieImport.cs b/BizHawk.Client.Common/movie/import/MovieImport.cs index 3e53523539..ab3cd70cc3 100644 --- a/BizHawk.Client.Common/movie/import/MovieImport.cs +++ b/BizHawk.Client.Common/movie/import/MovieImport.cs @@ -69,9 +69,9 @@ namespace BizHawk.Client.Common // Attempt to import another type of movie file into a movie object. public static Bk2Movie ImportFile(string path, out string errorMsg, out string warningMsg) { - errorMsg = string.Empty; - warningMsg = string.Empty; - string ext = path != null ? Path.GetExtension(path).ToUpper() : string.Empty; + errorMsg = ""; + warningMsg = ""; + string ext = path != null ? Path.GetExtension(path).ToUpper() : ""; if (UsesLegacyImporter(ext)) { @@ -133,8 +133,8 @@ namespace BizHawk.Client.Common private static BkmMovie LegacyImportFile(string ext, string path, out string errorMsg, out string warningMsg) { - errorMsg = string.Empty; - warningMsg = string.Empty; + errorMsg = ""; + warningMsg = ""; BkmMovie m = new BkmMovie(); @@ -261,8 +261,8 @@ namespace BizHawk.Client.Common private static BkmMovie ImportTextFrame(string line, int lineNum, BkmMovie m, string path, string platform, ref string warningMsg) { string[] buttons = { }; - var controller = string.Empty; - var ext = path != null ? Path.GetExtension(path).ToUpper() : string.Empty; + var controller = ""; + var ext = path != null ? Path.GetExtension(path).ToUpper() : ""; switch (ext) { case ".FM2": @@ -327,7 +327,7 @@ namespace BizHawk.Client.Common break; } - if (warningMsg != string.Empty) + if (warningMsg != "") { warningMsg = "Unable to import " + warningMsg + " command on line " + lineNum + "."; } @@ -339,7 +339,7 @@ namespace BizHawk.Client.Common char[] off = { '.', ' ', '\t', '\n', '\r' }; if (flags.Length == 0 || off.Contains(flags[0])) { - if (warningMsg == string.Empty) + if (warningMsg == "") { warningMsg = "Unable to import subframe."; } @@ -351,7 +351,7 @@ namespace BizHawk.Client.Common flags = SingleSpaces(flags.Substring(2)); if (reset && ((flags.Length >= 2 && flags[1] != '0') || (flags.Length >= 4 && flags[3] != '0'))) { - if (warningMsg == string.Empty) + if (warningMsg == "") { warningMsg = "Unable to import delayed reset."; } @@ -384,7 +384,7 @@ namespace BizHawk.Client.Common // Gameboy doesn't currently have a prefix saying which player the input is for. if (controllers.Definition.Name == "Gameboy Controller") { - prefix = string.Empty; + prefix = ""; } // Only count lines with that have the right number of buttons and are for valid players. @@ -418,7 +418,7 @@ namespace BizHawk.Client.Common // Concatenate the frame and message with default values for the additional fields. string frame; string length; - string ext = path != null ? Path.GetExtension(path).ToUpper() : string.Empty; + string ext = path != null ? Path.GetExtension(path).ToUpper() : ""; if (ext != ".LSMV") { @@ -441,12 +441,12 @@ namespace BizHawk.Client.Common // Import a text-based movie format. This works for .FM2, .MC2, and .YMV. private static BkmMovie ImportText(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; var m = new BkmMovie(path); var file = new FileInfo(path); var sr = file.OpenText(); - var emulator = string.Empty; - var platform = string.Empty; + var emulator = ""; + var platform = ""; switch (Path.GetExtension(path).ToUpper()) { case ".FM2": @@ -468,14 +468,14 @@ namespace BizHawk.Client.Common while ((line = sr.ReadLine()) != null) { lineNum++; - if (line == string.Empty) + if (line == "") { continue; } else if (line[0] == '|') { m = ImportTextFrame(line, lineNum, m, path, platform, ref warningMsg); - if (errorMsg != string.Empty) + if (errorMsg != "") { sr.Close(); return null; @@ -637,7 +637,7 @@ namespace BizHawk.Client.Common // FCM file format: http://code.google.com/p/fceu/wiki/FCM private static BkmMovie ImportFCM(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; BkmMovie m = new BkmMovie(path); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); @@ -805,7 +805,7 @@ namespace BizHawk.Client.Common // bbbbb: controllers["Reset"] = command == 1; - if (warningMsg == string.Empty) + if (warningMsg == "") { switch (command) { @@ -845,7 +845,7 @@ namespace BizHawk.Client.Common break; } - if (warningMsg != string.Empty) + if (warningMsg != "") { warningMsg = "Unable to import " + warningMsg + " command at frame " + frame + "."; } @@ -919,7 +919,7 @@ namespace BizHawk.Client.Common // FMV file format: http://tasvideos.org/FMV.html private static BkmMovie ImportFmv(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; BkmMovie m = new BkmMovie(path); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); @@ -1078,7 +1078,7 @@ namespace BizHawk.Client.Common // GMV file format: http://code.google.com/p/gens-rerecording/wiki/GMV private static BkmMovie ImportGMV(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; var m = new BkmMovie(path); var fs = new FileStream(path, FileMode.Open, FileAccess.Read); var r = new BinaryReader(fs); @@ -1220,7 +1220,7 @@ namespace BizHawk.Client.Common // LSMV file format: http://tasvideos.org/Lsnes/Movieformat.html private static BkmMovie ImportLSMV(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; var m = new BkmMovie(path); var hf = new HawkFile(path); @@ -1238,8 +1238,8 @@ namespace BizHawk.Client.Common hf.BindArchiveMember(item.Index); var stream = hf.GetStream(); string authors = Encoding.UTF8.GetString(stream.ReadAllBytes()); - string author_list = string.Empty; - string author_last = string.Empty; + string author_list = ""; + string author_last = ""; using (var reader = new StringReader(authors)) { string line; @@ -1248,9 +1248,9 @@ namespace BizHawk.Client.Common while ((line = reader.ReadLine()) != null) { string author = line.Trim(); - if (author != string.Empty) + if (author != "") { - if (author_last != string.Empty) + if (author_last != "") { author_list += author_last + ", "; } @@ -1260,12 +1260,12 @@ namespace BizHawk.Client.Common } } - if (author_list != string.Empty) + if (author_list != "") { author_list += "and "; } - if (author_last != string.Empty) + if (author_last != "") { author_list += author_last; } @@ -1329,7 +1329,7 @@ namespace BizHawk.Client.Common string line; while ((line = reader.ReadLine()) != null) { - if (line == string.Empty) + if (line == "") { continue; } @@ -1348,7 +1348,7 @@ namespace BizHawk.Client.Common } m = ImportTextFrame(line, lineNum, m, path, platform, ref warningMsg); - if (errorMsg != string.Empty) + if (errorMsg != "") { hf.Unbind(); return null; @@ -1487,7 +1487,7 @@ namespace BizHawk.Client.Common */ private static BkmMovie ImportMCM(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; BkmMovie m = new BkmMovie(path); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); @@ -1609,12 +1609,12 @@ namespace BizHawk.Client.Common ushort controllerState = r.ReadByte(); for (int button = 0; button < buttons.Length; button++) { - string prefix = platform == "lynx" ? string.Empty : "P" + player + " "; // hack + string prefix = platform == "lynx" ? "" : "P" + player + " "; // hack controllers[prefix + buttons[button]] = ((controllerState >> button) & 0x1) != 0; } } r.ReadByte(); - if (platform == "nes" && warningMsg == string.Empty) + if (platform == "nes" && warningMsg == "") { warningMsg = "Control commands are not properly supported."; } @@ -1636,7 +1636,7 @@ namespace BizHawk.Client.Common // MMV file format: http://tasvideos.org/MMV.html private static BkmMovie ImportMMV(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; BkmMovie m = new BkmMovie(path); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); @@ -1769,7 +1769,7 @@ namespace BizHawk.Client.Common // NMV file format: http://tasvideos.org/NMV.html private static BkmMovie ImportNMV(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; var m = new BkmMovie(path); var fs = new FileStream(path, FileMode.Open, FileAccess.Read); var r = new BinaryReader(fs); @@ -1866,7 +1866,7 @@ namespace BizHawk.Client.Common masks[controller - 1] = types[controller - 1] == 1; // Get the first unsupported controller warning message that arises. - if (warningMsg == string.Empty) + if (warningMsg == "") { switch (types[controller - 1]) { @@ -1892,7 +1892,7 @@ namespace BizHawk.Client.Common break; } - if (warningMsg != string.Empty) + if (warningMsg != "") { warningMsg = warningMsg + " is not properly supported."; } @@ -1919,7 +1919,7 @@ namespace BizHawk.Client.Common "Unconnected", "Famicom 4-player adapter", "Famicom Arkanoid paddle", "Family Basic Keyboard", "Alternate keyboard layout", "Family Trainer", "Oeka Kids writing tablet" }; - if (expansion != 0 && warningMsg == string.Empty) + if (expansion != 0 && warningMsg == "") { warningMsg = "Expansion port is not properly supported. This movie uses " + expansions[expansion] + "."; } @@ -2005,7 +2005,7 @@ namespace BizHawk.Client.Common controllers["P" + player + " " + buttons[button]] = ((controllerState >> button) & 0x1) != 0; } } - else if (warningMsg == string.Empty) + else if (warningMsg == "") { warningMsg = "Extra input is not properly supported."; } @@ -2021,7 +2021,7 @@ namespace BizHawk.Client.Common private static BkmMovie ImportSmv(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; BkmMovie m = new BkmMovie(path); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); @@ -2170,7 +2170,7 @@ namespace BizHawk.Client.Common */ byte[] metadata = r.ReadBytes((int)(savestateOffset - extraRomInfo - ((version != "1.43") ? 0x40 : 0x20))); string author = NullTerminated(Encoding.Unicode.GetString(metadata).Trim()); - if (author != string.Empty) + if (author != "") { m.Header[HeaderKeys.AUTHOR] = author; } @@ -2244,7 +2244,7 @@ namespace BizHawk.Client.Common */ if (version != "1.43" && player <= controllerTypes.Length) { - var peripheral = string.Empty; + var peripheral = ""; switch (controllerTypes[player - 1]) { case 0: // NONE @@ -2272,7 +2272,7 @@ namespace BizHawk.Client.Common break; } - if (peripheral != string.Empty && warningMsg == string.Empty) + if (peripheral != "" && warningMsg == "") { warningMsg = "Unable to import " + peripheral + "."; } @@ -2287,7 +2287,7 @@ namespace BizHawk.Client.Common ((controllerState >> button) & 0x1) != 0; } } - else if (warningMsg == string.Empty) + else if (warningMsg == "") { warningMsg = "Controller " + player + " not supported."; } @@ -2314,7 +2314,7 @@ namespace BizHawk.Client.Common // VBM file format: http://code.google.com/p/vba-rerecording/wiki/VBM private static BkmMovie ImportVbm(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; var m = new BkmMovie(path); var fs = new FileStream(path, FileMode.Open, FileAccess.Read); var r = new BinaryReader(fs); @@ -2585,7 +2585,7 @@ namespace BizHawk.Client.Common } // TODO: Handle the other buttons. - if (warningMsg == string.Empty) + if (warningMsg == "") { for (int button = 0; button < other.Length; button++) { @@ -2617,7 +2617,7 @@ namespace BizHawk.Client.Common // VMV file format: http://tasvideos.org/VMV.html private static BkmMovie ImportVmv(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; BkmMovie m = new BkmMovie(path); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); @@ -2768,7 +2768,7 @@ namespace BizHawk.Client.Common if (controllerState == 0xF0) { ushort command = r.ReadUInt16(); - string commandName = string.Empty; + string commandName = ""; if ((command & 0xFF00) == 0) { switch (command & 0x00FF) @@ -2815,7 +2815,7 @@ namespace BizHawk.Client.Common commandName = "NESCMD_EXCONTROLLER, " + (command & 0xFF00); } - if (commandName != string.Empty && warningMsg == string.Empty) + if (commandName != "" && warningMsg == "") { warningMsg = "Unable to run command \"" + commandName + "\"."; } @@ -2825,7 +2825,7 @@ namespace BizHawk.Client.Common uint dwdata = r.ReadUInt32(); // TODO: Make a clearer warning message. - if (warningMsg == string.Empty) + if (warningMsg == "") { warningMsg = "Unable to run SetSyncExData(" + dwdata + ")."; } @@ -2857,7 +2857,7 @@ namespace BizHawk.Client.Common // ZMV file format: http://tasvideos.org/ZMV.html private static BkmMovie ImportZmv(string path, out string errorMsg, out string warningMsg) { - errorMsg = warningMsg = string.Empty; + errorMsg = warningMsg = ""; BkmMovie m = new BkmMovie(path); FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); @@ -2925,7 +2925,7 @@ namespace BizHawk.Client.Common bit 0: super scope in second port */ byte controllerFlags = r.ReadByte(); - string peripheral = string.Empty; + string peripheral = ""; bool superScope = (controllerFlags & 0x1) != 0; if (superScope) { @@ -2934,19 +2934,19 @@ namespace BizHawk.Client.Common controllerFlags >>= 1; bool secondMouse = (controllerFlags & 0x1) != 0; - if (secondMouse && peripheral == string.Empty) + if (secondMouse && peripheral == "") { peripheral = "Second Mouse"; } controllerFlags >>= 1; bool firstMouse = (controllerFlags & 0x1) != 0; - if (firstMouse && peripheral == string.Empty) + if (firstMouse && peripheral == "") { peripheral = "First Mouse"; } - if (peripheral != string.Empty) + if (peripheral != "") { warningMsg = "Unable to import " + peripheral + "."; } @@ -3159,7 +3159,7 @@ namespace BizHawk.Client.Common } } } - else if (warningMsg == string.Empty) + else if (warningMsg == "") { warningMsg = "Controller " + player + " not supported."; } diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs index 4ef3d4225e..2150e621f0 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs @@ -160,7 +160,7 @@ namespace BizHawk.Client.Common bl.GetLump(BinaryStateLump.Input, true, delegate(TextReader tr) // Note: ExtractInputLog will clear Lag and State data potentially, this must come before loading those { - var errorMessage = string.Empty; + var errorMessage = ""; IsCountingRerecords = false; ExtractInputLog(tr, out errorMessage); IsCountingRerecords = true; @@ -212,7 +212,7 @@ namespace BizHawk.Client.Common if (GetClientSettingsOnLoad != null) { - string clientSettings = string.Empty; + string clientSettings = ""; bl.GetLump(BinaryStateLump.ClientSettings, false, delegate(TextReader tr) { string line; diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index c0d75b5846..d29e1dc288 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -18,7 +18,7 @@ namespace BizHawk.Client.Common public const string DefaultProjectName = "default"; public BackgroundWorker _progressReportWorker = null; public bool LastPositionStable = true; - public string NewBranchText = string.Empty; + public string NewBranchText = ""; public readonly IStringLog VerificationLog = StringLogUtil.MakeStringLog(); // For movies that do not begin with power-on, this is the input required to get into the initial state public readonly TasBranchCollection Branches = new TasBranchCollection(); public readonly TasSession Session; @@ -194,7 +194,7 @@ namespace BizHawk.Client.Common { return adapter.IsPressed(buttonName) ? Mnemonics[buttonName].ToString() : - string.Empty; + ""; } if (adapter.Definition.FloatControls.Contains(buttonName)) @@ -287,7 +287,7 @@ namespace BizHawk.Client.Common // TODO: this is 99% copy pasting of bad code public override bool ExtractInputLog(TextReader reader, out string errorMessage) { - errorMessage = string.Empty; + errorMessage = ""; int? stateFrame = null; var newLog = new List(); diff --git a/BizHawk.Client.Common/tools/Cheat.cs b/BizHawk.Client.Common/tools/Cheat.cs index 469bdaf616..4bc76388a0 100644 --- a/BizHawk.Client.Common/tools/Cheat.cs +++ b/BizHawk.Client.Common/tools/Cheat.cs @@ -85,7 +85,7 @@ namespace BizHawk.Client.Common public char TypeAsChar => _watch.TypeAsChar; - public string Name => IsSeparator ? string.Empty : _watch.Notes; + public string Name => IsSeparator ? "" : _watch.Notes; public string AddressStr => _watch.AddressString; @@ -97,7 +97,7 @@ namespace BizHawk.Client.Common { default: case WatchSize.Separator: - return string.Empty; + return ""; case WatchSize.Byte: return (_watch as ByteWatch).FormatValue((byte)_val); case WatchSize.Word: @@ -118,7 +118,7 @@ namespace BizHawk.Client.Common { default: case WatchSize.Separator: - return string.Empty; + return ""; case WatchSize.Byte: return (_watch as ByteWatch).FormatValue((byte)_compare.Value); case WatchSize.Word: @@ -128,7 +128,7 @@ namespace BizHawk.Client.Common } } - return string.Empty; + return ""; } } diff --git a/BizHawk.Client.Common/tools/CheatList.cs b/BizHawk.Client.Common/tools/CheatList.cs index bfcad4710e..d4615721e0 100644 --- a/BizHawk.Client.Common/tools/CheatList.cs +++ b/BizHawk.Client.Common/tools/CheatList.cs @@ -14,8 +14,8 @@ namespace BizHawk.Client.Common public class CheatCollection : ICollection { private List _cheatList = new List(); - private string _currentFileName = string.Empty; - private string _defaultFileName = string.Empty; + private string _currentFileName = ""; + private string _defaultFileName = ""; private bool _changes; public delegate void CheatListEventHandler(object sender, CheatListEventArgs e); @@ -109,7 +109,7 @@ namespace BizHawk.Client.Common } _cheatList.Clear(); - _currentFileName = string.Empty; + _currentFileName = ""; Changes = false; } @@ -384,7 +384,7 @@ namespace BizHawk.Client.Common .Append(cheat.AddressStr).Append('\t') .Append(cheat.ValueStr).Append('\t') .Append(cheat.Compare?.ToString() ?? "N").Append('\t') - .Append(cheat.Domain != null ? cheat.Domain.Name : string.Empty).Append('\t') + .Append(cheat.Domain != null ? cheat.Domain.Name : "").Append('\t') .Append(cheat.Enabled ? '1' : '0').Append('\t') .Append(cheat.Name).Append('\t') .Append(cheat.SizeAsChar).Append('\t') diff --git a/BizHawk.Client.Common/tools/RamSearchEngine.cs b/BizHawk.Client.Common/tools/RamSearchEngine.cs index a7d52b25a7..cbc442746d 100644 --- a/BizHawk.Client.Common/tools/RamSearchEngine.cs +++ b/BizHawk.Client.Common/tools/RamSearchEngine.cs @@ -148,7 +148,7 @@ namespace BizHawk.Client.Common _settings.Size, _settings.Type, _settings.BigEndian, - string.Empty, + "", 0, _watchList[index].Previous, (_watchList[index] as IMiniWatchDetails).ChangeCount); @@ -161,7 +161,7 @@ namespace BizHawk.Client.Common _settings.Size, _settings.Type, _settings.BigEndian, - string.Empty, + "", 0, _watchList[index].Previous, 0); diff --git a/BizHawk.Client.Common/tools/Watch/ByteWatch.cs b/BizHawk.Client.Common/tools/Watch/ByteWatch.cs index 93ac6d1873..e44b6c0c7e 100644 --- a/BizHawk.Client.Common/tools/Watch/ByteWatch.cs +++ b/BizHawk.Client.Common/tools/Watch/ByteWatch.cs @@ -232,7 +232,7 @@ namespace BizHawk.Client.Common { get { - string diff = string.Empty; + string diff = ""; int diffVal = _value - _previous; if (diffVal > 0) { diff --git a/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs b/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs index ecf1b2aec0..618c8e5da3 100644 --- a/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs +++ b/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs @@ -12,7 +12,7 @@ namespace BizHawk.Client.Common /// Initialize a new separator instance /// internal SeparatorWatch() - : base(null, 0, WatchSize.Separator, DisplayType.Separator, true, string.Empty) + : base(null, 0, WatchSize.Separator, DisplayType.Separator, true, "") { } @@ -50,12 +50,12 @@ namespace BizHawk.Client.Common /// /// Ignore that stuff /// - public override string ValueString => string.Empty; + public override string ValueString => ""; /// /// Ignore that stuff /// - public override string PreviousStr => string.Empty; + public override string PreviousStr => ""; /// /// TTransform the current instance into a displayable (short representation) string @@ -85,7 +85,7 @@ namespace BizHawk.Client.Common /// /// Ignore that stuff /// - public override string Diff => string.Empty; + public override string Diff => ""; /// /// Ignore that stuff diff --git a/BizHawk.Client.Common/tools/Watch/Watch.cs b/BizHawk.Client.Common/tools/Watch/Watch.cs index 560a9febdc..ac987ca2e7 100644 --- a/BizHawk.Client.Common/tools/Watch/Watch.cs +++ b/BizHawk.Client.Common/tools/Watch/Watch.cs @@ -197,7 +197,7 @@ namespace BizHawk.Client.Common /// New instance. True type is depending of size parameter public static Watch GenerateWatch(MemoryDomain domain, long address, WatchSize size, DisplayType type, bool bigEndian) { - return GenerateWatch(domain, address, size, type, bigEndian, string.Empty, 0, 0, 0); + return GenerateWatch(domain, address, size, type, bigEndian, "", 0, 0, 0); } #region Operators @@ -364,8 +364,8 @@ namespace BizHawk.Client.Common { // LIAR logic return (ushort)(Global.CheatList.GetCheatValue(_domain, _address, WatchSize.Word) ?? 0); - } - + } + if (_domain.Size == 0) { return _domain.PeekUshort(_address, _bigEndian); @@ -404,24 +404,24 @@ namespace BizHawk.Client.Common protected void PokeWord(ushort val) { - if (_domain.Size == 0) - { + if (_domain.Size == 0) + { _domain.PokeUshort(_address, val, _bigEndian); // TODO: % size stil lisn't correct since it could be the last byte of the domain } - else - { + else + { _domain.PokeUshort(_address % _domain.Size, val, _bigEndian); // TODO: % size stil lisn't correct since it could be the last byte of the domain } } protected void PokeDWord(uint val) { - if (_domain.Size == 0) - { + if (_domain.Size == 0) + { _domain.PokeUint(_address, val, _bigEndian); // TODO: % size stil lisn't correct since it could be the last byte of the domain } - else - { + else + { _domain.PokeUint(_address % _domain.Size, val, _bigEndian); // TODO: % size stil lisn't correct since it could be the last byte of the domain } } @@ -642,7 +642,7 @@ namespace BizHawk.Client.Common return "X" + (_domain.Size - 1).NumHexDigits(); } - return string.Empty; + return ""; } } @@ -731,7 +731,7 @@ namespace BizHawk.Client.Common } else { - return string.Empty; + return ""; } } } diff --git a/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs b/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs index 29475da630..1f80e3944c 100644 --- a/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs +++ b/BizHawk.Client.Common/tools/Watch/WatchList/WatchList.cs @@ -42,7 +42,7 @@ namespace BizHawk.Client.Common private IMemoryDomains _memoryDomains; private List _watchList = new List(0); - private string _currentFilename = string.Empty; + private string _currentFilename = ""; private string _systemid; #endregion @@ -86,7 +86,7 @@ namespace BizHawk.Client.Common { _watchList.Clear(); Changes = false; - _currentFilename = string.Empty; + _currentFilename = ""; } /// diff --git a/BizHawk.Client.Common/tools/Watch/WordWatch.cs b/BizHawk.Client.Common/tools/Watch/WordWatch.cs index 9376ec25ca..314034ac21 100644 --- a/BizHawk.Client.Common/tools/Watch/WordWatch.cs +++ b/BizHawk.Client.Common/tools/Watch/WordWatch.cs @@ -245,7 +245,7 @@ namespace BizHawk.Client.Common { get { - string diff = string.Empty; + string diff = ""; int diffVal = _value - _previous; if (diffVal > 0) { diff --git a/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs b/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs index aa68f2d4e8..1afbc35bf4 100644 --- a/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs +++ b/BizHawk.Client.EmuHawk/AVOut/SynclessRecordingTools.cs @@ -46,7 +46,7 @@ namespace BizHawk.Client.EmuHawk //---- this is pretty crappy: var lines = File.ReadAllLines(mSynclessConfigFile); - string framesdir = string.Empty; + string framesdir = ""; foreach (var line in lines) { int idx = line.IndexOf('='); diff --git a/BizHawk.Client.EmuHawk/AVOut/VideoWriterChooserForm.cs b/BizHawk.Client.EmuHawk/AVOut/VideoWriterChooserForm.cs index d5f6dbe52b..8ef96ae9e1 100644 --- a/BizHawk.Client.EmuHawk/AVOut/VideoWriterChooserForm.cs +++ b/BizHawk.Client.EmuHawk/AVOut/VideoWriterChooserForm.cs @@ -51,7 +51,7 @@ namespace BizHawk.Client.EmuHawk { VideoWriterChooserForm dlg = new VideoWriterChooserForm { - labelDescriptionBody = { Text = string.Empty } + labelDescriptionBody = { Text = "" } }; int idx = 0; @@ -113,7 +113,7 @@ namespace BizHawk.Client.EmuHawk { labelDescriptionBody.Text = listBox1.SelectedIndex != -1 ? ((VideoWriterInfo)listBox1.SelectedItem).Attribs.Description - : string.Empty; + : ""; } private void checkBoxResize_CheckedChanged(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/BizBoxInfoControl.cs b/BizHawk.Client.EmuHawk/BizBoxInfoControl.cs index c1d8fc4d2f..105dccafd6 100644 --- a/BizHawk.Client.EmuHawk/BizBoxInfoControl.cs +++ b/BizHawk.Client.EmuHawk/BizBoxInfoControl.cs @@ -13,7 +13,7 @@ namespace BizHawk.Client.EmuHawk { public partial class BizBoxInfoControl : UserControl { - private string url = string.Empty; + private string url = ""; public BizBoxInfoControl(CoreAttributes attributes) { @@ -29,7 +29,7 @@ namespace BizHawk.Client.EmuHawk CoreAuthorLabel.Visible = false; } - CorePortedLabel.Text = attributes.Ported ? " (Ported)" : string.Empty; + CorePortedLabel.Text = attributes.Ported ? " (Ported)" : ""; if (!attributes.Ported) { diff --git a/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs b/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs index 1b09703a87..419699ced6 100644 --- a/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs +++ b/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs @@ -135,7 +135,7 @@ namespace BizHawk.Client.EmuHawk { var ret = new TreeNode { - Text = ci.CoreName + (ci.Released ? string.Empty : " (UNRELEASED)"), + Text = ci.CoreName + (ci.Released ? "" : " (UNRELEASED)"), ForeColor = ci.Released ? Color.Black : Color.DarkGray }; @@ -255,7 +255,7 @@ namespace BizHawk.Client.EmuHawk string img = "Unknown"; var coreNode = new TreeNode { - Text = t.CoreAttributes.CoreName + (t.CoreAttributes.Released ? string.Empty : " (UNRELEASED)"), + Text = t.CoreAttributes.CoreName + (t.CoreAttributes.Released ? "" : " (UNRELEASED)"), ForeColor = t.CoreAttributes.Released ? Color.Black : Color.DarkGray, ImageKey = img, SelectedImageKey = img, diff --git a/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs b/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs index b4b3569a59..4e0c3e9733 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/HexTextBox.cs @@ -17,7 +17,7 @@ namespace BizHawk.Client.EmuHawk public class HexTextBox : TextBox, INumberBox { - private string _addressFormatStr = string.Empty; + private string _addressFormatStr = ""; private long? _maxSize; private bool _nullable = true; @@ -65,7 +65,7 @@ namespace BizHawk.Client.EmuHawk public override void ResetText() { - Text = _nullable ? string.Empty : string.Format(_addressFormatStr, 0); + Text = _nullable ? "" : string.Format(_addressFormatStr, 0); } protected override void OnKeyPress(KeyPressEventArgs e) @@ -153,7 +153,7 @@ namespace BizHawk.Client.EmuHawk public void SetFromRawInt(int? val) { - Text = val.HasValue ? string.Format(_addressFormatStr, val) : string.Empty; + Text = val.HasValue ? string.Format(_addressFormatStr, val) : ""; } public void SetFromLong(long val) @@ -203,7 +203,7 @@ namespace BizHawk.Client.EmuHawk public override void ResetText() { - Text = _nullable ? string.Empty : "0"; + Text = _nullable ? "" : "0"; } protected override void OnKeyDown(KeyEventArgs e) @@ -278,7 +278,7 @@ namespace BizHawk.Client.EmuHawk public void SetFromRawInt(int? val) { - Text = val.HasValue ? val.ToString() : string.Empty; + Text = val.HasValue ? val.ToString() : ""; } } } diff --git a/BizHawk.Client.EmuHawk/CustomControls/TasListView.cs b/BizHawk.Client.EmuHawk/CustomControls/TasListView.cs index 79965a20d3..0038c26e20 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/TasListView.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/TasListView.cs @@ -59,7 +59,7 @@ namespace BizHawk.Client.EmuHawk private void CalculatePointedCell(int x, int y) { int? newRow; - string newColumn = String.Empty; + string newColumn = ""; var accumulator = 0; foreach (ColumnHeader column in Columns) @@ -120,7 +120,7 @@ namespace BizHawk.Client.EmuHawk protected override void OnMouseLeave(EventArgs e) { - _currentPointedCell.Column = String.Empty; + _currentPointedCell.Column = ""; _currentPointedCell.RowIndex = null; IsPaintDown = false; base.OnMouseLeave(e); diff --git a/BizHawk.Client.EmuHawk/DisplayManager/OSDManager.cs b/BizHawk.Client.EmuHawk/DisplayManager/OSDManager.cs index 938d3c1dee..5d6ea34df4 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/OSDManager.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/OSDManager.cs @@ -249,7 +249,7 @@ namespace BizHawk.Client.EmuHawk } } - return string.Empty; + return ""; } public string InputStrOrAll() @@ -293,7 +293,7 @@ namespace BizHawk.Client.EmuHawk return lg.GenerateInputDisplay(); } - return string.Empty; + return ""; } public string MakeRerecordCount() @@ -303,7 +303,7 @@ namespace BizHawk.Client.EmuHawk return Global.MovieSession.Movie.Rerecords.ToString(); } - return string.Empty; + return ""; } private void DrawOsdMessage(IBlitter g, string message, Color color, float x, float y) diff --git a/BizHawk.Client.EmuHawk/Extensions/ControlExtensions.cs b/BizHawk.Client.EmuHawk/Extensions/ControlExtensions.cs index af93e22bf9..5221e522ed 100644 --- a/BizHawk.Client.EmuHawk/Extensions/ControlExtensions.cs +++ b/BizHawk.Client.EmuHawk/Extensions/ControlExtensions.cs @@ -52,7 +52,7 @@ namespace BizHawk.Client.EmuHawk.WinFormExtensions var column = new ColumnHeader { Name = columnName, - Text = columnName.Replace("Column", string.Empty), + Text = columnName.Replace("Column", ""), Width = columnWidth, }; @@ -70,7 +70,7 @@ namespace BizHawk.Client.EmuHawk.WinFormExtensions var lsstViewColumn = new ColumnHeader { Name = column.Name, - Text = column.Name.Replace("Column", string.Empty), + Text = column.Name.Replace("Column", ""), Width = column.Width, DisplayIndex = column.Index }; @@ -95,7 +95,7 @@ namespace BizHawk.Client.EmuHawk.WinFormExtensions var menuItem = new ToolStripMenuItem { Name = column.Name, - Text = column.Name.Replace("Column", string.Empty) + Text = column.Name.Replace("Column", "") }; menuItem.Click += (o, ev) => @@ -239,7 +239,7 @@ namespace BizHawk.Client.EmuHawk.WinFormExtensions var indexes = listViewControl.SelectedIndices; if (indexes.Count <= 0) { - return String.Empty; + return ""; } var sb = new StringBuilder(); diff --git a/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs b/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs index 603c346266..822451cdd6 100644 --- a/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs +++ b/BizHawk.Client.EmuHawk/Extensions/CoreExtensions.cs @@ -74,7 +74,7 @@ namespace BizHawk.Client.EmuHawk.CoreExtensions { var attributes = core.Attributes(); - var str = (!attributes.Released ? "(Experimental) " : string.Empty) + + var str = (!attributes.Released ? "(Experimental) " : "") + attributes.CoreName; if (core is LibsnesCore) diff --git a/BizHawk.Client.EmuHawk/FileLoader.cs b/BizHawk.Client.EmuHawk/FileLoader.cs index 1e7224bfb4..f0c0f7e492 100644 --- a/BizHawk.Client.EmuHawk/FileLoader.cs +++ b/BizHawk.Client.EmuHawk/FileLoader.cs @@ -171,7 +171,7 @@ namespace BizHawk.Client.EmuHawk { foreach (string file in fileList) { - var ext = Path.GetExtension(file).ToUpper() ?? String.Empty; + var ext = Path.GetExtension(file).ToUpper() ?? ""; FileInformation fileInformation = new FileInformation(Path.GetDirectoryName(file), Path.GetFileName(file), archive); switch (ext) diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index e51104a67f..9313feb99f 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -2905,7 +2905,7 @@ namespace BizHawk.Client.EmuHawk return; } - var ext = Path.GetExtension(filePaths[0]) ?? string.Empty; + var ext = Path.GetExtension(filePaths[0]) ?? ""; if (ext.ToUpper() == ".LUASES") { OpenLuaConsole(); diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index feab8a234f..0749dbd4b3 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -1198,7 +1198,7 @@ namespace BizHawk.Client.EmuHawk } else { - CheatStatusButton.ToolTipText = string.Empty; + CheatStatusButton.ToolTipText = ""; CheatStatusButton.Image = Properties.Resources.Blank; CheatStatusButton.Visible = false; } @@ -1485,7 +1485,7 @@ namespace BizHawk.Client.EmuHawk public void UpdateDumpIcon() { DumpStatusButton.Image = Properties.Resources.Blank; - DumpStatusButton.ToolTipText = string.Empty; + DumpStatusButton.ToolTipText = ""; if (Emulator.IsNull()) { @@ -1641,7 +1641,7 @@ namespace BizHawk.Client.EmuHawk private void HandlePlatformMenus() { - var system = string.Empty; + var system = ""; if (!Global.Game.IsNullInstance) { //New Code @@ -1835,7 +1835,7 @@ namespace BizHawk.Client.EmuHawk { PauseStatusButton.Image = Properties.Resources.Blank; PauseStatusButton.Visible = false; - PauseStatusButton.ToolTipText = string.Empty; + PauseStatusButton.ToolTipText = ""; } } @@ -2676,7 +2676,7 @@ namespace BizHawk.Client.EmuHawk CoreNameStatusBarButton.Text = Emulator.DisplayName(); CoreNameStatusBarButton.Image = Emulator.Icon(); - CoreNameStatusBarButton.ToolTipText = attributes.Ported ? "(ported) " : string.Empty; + CoreNameStatusBarButton.ToolTipText = attributes.Ported ? "(ported) " : ""; } #endregion @@ -3170,7 +3170,7 @@ namespace BizHawk.Client.EmuHawk _currAviWriter = null; GlobalWin.OSD.AddMessage("A/V capture aborted"); AVIStatusLabel.Image = Properties.Resources.Blank; - AVIStatusLabel.ToolTipText = string.Empty; + AVIStatusLabel.ToolTipText = ""; AVIStatusLabel.Visible = false; _aviSoundInputAsync = null; _dumpProxy = null; // return to normal sound output @@ -3191,7 +3191,7 @@ namespace BizHawk.Client.EmuHawk _currAviWriter = null; GlobalWin.OSD.AddMessage("A/V capture stopped"); AVIStatusLabel.Image = Properties.Resources.Blank; - AVIStatusLabel.ToolTipText = string.Empty; + AVIStatusLabel.ToolTipText = ""; AVIStatusLabel.Visible = false; _aviSoundInputAsync = null; _dumpProxy = null; // return to normal sound output @@ -3702,7 +3702,7 @@ namespace BizHawk.Client.EmuHawk GlobalWin.Tools.Restart(); RewireSound(); - Text = "BizHawk" + (VersionInfo.DeveloperBuild ? " (interim) " : string.Empty); + Text = "BizHawk" + (VersionInfo.DeveloperBuild ? " (interim) " : ""); HandlePlatformMenus(); _stateSlots.Clear(); UpdateDumpIcon(); diff --git a/BizHawk.Client.EmuHawk/PlatformChooser.cs b/BizHawk.Client.EmuHawk/PlatformChooser.cs index f3ca9402b5..da68589504 100644 --- a/BizHawk.Client.EmuHawk/PlatformChooser.cs +++ b/BizHawk.Client.EmuHawk/PlatformChooser.cs @@ -74,7 +74,7 @@ namespace BizHawk.Client.EmuHawk private void OkBtn_Click(object sender, EventArgs e) { - var selectedValue = SelectedRadio != null ? SelectedRadio.Text : string.Empty; + var selectedValue = SelectedRadio != null ? SelectedRadio.Text : ""; PlatformChoice = AvailableSystems.FirstOrDefault(x => x.FullName == selectedValue).SystemId; if (AlwaysCheckbox.Checked) diff --git a/BizHawk.Client.EmuHawk/config/ControllerConfig.cs b/BizHawk.Client.EmuHawk/config/ControllerConfig.cs index 59e07f8119..0c78e0720e 100644 --- a/BizHawk.Client.EmuHawk/config/ControllerConfig.cs +++ b/BizHawk.Client.EmuHawk/config/ControllerConfig.cs @@ -201,9 +201,9 @@ namespace BizHawk.Client.EmuHawk IDictionary> autofire, IDictionary> analog) { - LoadToPanel(NormalControlsTab, _theDefinition.Name, _theDefinition.BoolButtons, _theDefinition.CategoryLabels, normal, string.Empty, CreateNormalPanel); - LoadToPanel(AutofireControlsTab, _theDefinition.Name, _theDefinition.BoolButtons, _theDefinition.CategoryLabels, autofire, string.Empty, CreateNormalPanel); - LoadToPanel(AnalogControlsTab, _theDefinition.Name, _theDefinition.FloatControls, _theDefinition.CategoryLabels, analog, new Config.AnalogBind(string.Empty, 1.0f, 0.1f), CreateAnalogPanel); + LoadToPanel(NormalControlsTab, _theDefinition.Name, _theDefinition.BoolButtons, _theDefinition.CategoryLabels, normal, "", CreateNormalPanel); + LoadToPanel(AutofireControlsTab, _theDefinition.Name, _theDefinition.BoolButtons, _theDefinition.CategoryLabels, autofire, "", CreateNormalPanel); + LoadToPanel(AnalogControlsTab, _theDefinition.Name, _theDefinition.FloatControls, _theDefinition.CategoryLabels, analog, new Config.AnalogBind("", 1.0f, 0.1f), CreateAnalogPanel); if (AnalogControlsTab.Controls.Count == 0) { diff --git a/BizHawk.Client.EmuHawk/config/FileExtensionPreferencesPicker.cs b/BizHawk.Client.EmuHawk/config/FileExtensionPreferencesPicker.cs index c82a7f8c8a..ce66aeae47 100644 --- a/BizHawk.Client.EmuHawk/config/FileExtensionPreferencesPicker.cs +++ b/BizHawk.Client.EmuHawk/config/FileExtensionPreferencesPicker.cs @@ -35,7 +35,7 @@ namespace BizHawk.Client.EmuHawk .FirstOrDefault(x => x.SystemId == PlatformDropdown.SelectedItem.ToString()).FullName; } - return string.Empty; + return ""; } } @@ -56,7 +56,7 @@ namespace BizHawk.Client.EmuHawk foreach (var val in dispVals) { - yield return AvailableSystems.FirstOrDefault(x => x.FullName == val).SystemId ?? string.Empty; + yield return AvailableSystems.FirstOrDefault(x => x.FullName == val).SystemId ?? ""; } } } @@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk var selectedItem = PlatformDropdown.Items .OfType() - .FirstOrDefault(item => item == (selectedSystem != null ? selectedSystem.FullName : string.Empty)); + .FirstOrDefault(item => item == (selectedSystem != null ? selectedSystem.FullName : "")); if (selectedItem != null) { diff --git a/BizHawk.Client.EmuHawk/config/InputWidget.cs b/BizHawk.Client.EmuHawk/config/InputWidget.cs index acc9aeddda..5572fd94d0 100644 --- a/BizHawk.Client.EmuHawk/config/InputWidget.cs +++ b/BizHawk.Client.EmuHawk/config/InputWidget.cs @@ -13,7 +13,7 @@ namespace BizHawk.Client.EmuHawk private readonly Timer _timer = new Timer(); private readonly List _bindings = new List(); - private string _wasPressed = string.Empty; + private string _wasPressed = ""; public InputCompositeWidget CompositeWidget; @@ -109,7 +109,7 @@ namespace BizHawk.Client.EmuHawk public void EraseMappings() { ClearBindings(); - Text = string.Empty; + Text = ""; } /// @@ -185,7 +185,7 @@ namespace BizHawk.Client.EmuHawk base.OnKeyUp(e); } - _wasPressed = string.Empty; + _wasPressed = ""; } protected override void OnKeyDown(KeyEventArgs e) diff --git a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs index 3b7a22bbd9..73fbb73560 100644 --- a/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs +++ b/BizHawk.Client.EmuHawk/config/N64/N64VideoPluginconfig.cs @@ -51,7 +51,7 @@ namespace BizHawk.Client.EmuHawk "1380 x 768" }; - private string previousPluginSelection = string.Empty; + private string previousPluginSelection = ""; private bool programmaticallyChangingPluginComboBox = false; public N64VideoPluginconfig() diff --git a/BizHawk.Client.EmuHawk/config/PathConfig.cs b/BizHawk.Client.EmuHawk/config/PathConfig.cs index c40f24c7f6..cff36b6ee7 100644 --- a/BizHawk.Client.EmuHawk/config/PathConfig.cs +++ b/BizHawk.Client.EmuHawk/config/PathConfig.cs @@ -134,7 +134,7 @@ namespace BizHawk.Client.EmuHawk var btn = new Button { - Text = string.Empty, + Text = "", Image = Properties.Resources.OpenFile, Location = new Point(widgetOffset, _y + buttonOffsetY), Size = new Size(buttonWidth, buttonHeight), @@ -158,7 +158,7 @@ namespace BizHawk.Client.EmuHawk var firmwareButton = new Button { Name = "Global", - Text = String.Empty, + Text = "", Image = Properties.Resources.Help, Location = new Point(UIHelper.ScaleX(115), _y + buttonOffsetY), Size = new Size(buttonWidth, buttonHeight), diff --git a/BizHawk.Client.EmuHawk/movie/EditCommentsForm.cs b/BizHawk.Client.EmuHawk/movie/EditCommentsForm.cs index 66f991f588..4ec912dd05 100644 --- a/BizHawk.Client.EmuHawk/movie/EditCommentsForm.cs +++ b/BizHawk.Client.EmuHawk/movie/EditCommentsForm.cs @@ -16,7 +16,7 @@ namespace BizHawk.Client.EmuHawk public EditCommentsForm() { InitializeComponent(); - _lastHeaderClicked = string.Empty; + _lastHeaderClicked = ""; _sortReverse = false; } diff --git a/BizHawk.Client.EmuHawk/movie/MovieDetails.cs b/BizHawk.Client.EmuHawk/movie/MovieDetails.cs index 769e9a65a9..eb374e51c8 100644 --- a/BizHawk.Client.EmuHawk/movie/MovieDetails.cs +++ b/BizHawk.Client.EmuHawk/movie/MovieDetails.cs @@ -13,8 +13,8 @@ namespace BizHawk.Client.EmuHawk public MovieDetails() { - Keys = string.Empty; - Values = string.Empty; + Keys = ""; + Values = ""; BackgroundColor = Color.White; } } diff --git a/BizHawk.Client.EmuHawk/movie/PlayMovie.cs b/BizHawk.Client.EmuHawk/movie/PlayMovie.cs index 81ca94fc65..fa4131d5a7 100644 --- a/BizHawk.Client.EmuHawk/movie/PlayMovie.cs +++ b/BizHawk.Client.EmuHawk/movie/PlayMovie.cs @@ -30,10 +30,10 @@ namespace BizHawk.Client.EmuHawk MovieView.QueryItemText += MovieView_QueryItemText; MovieView.VirtualMode = true; _sortReverse = false; - _sortedCol = string.Empty; + _sortedCol = ""; _sortDetailsReverse = false; - _sortedDetailsCol = string.Empty; + _sortedDetailsCol = ""; } private void PlayMovie_Load(object sender, EventArgs e) @@ -47,7 +47,7 @@ namespace BizHawk.Client.EmuHawk private void MovieView_QueryItemText(int index, int column, out string text) { - text = string.Empty; + text = ""; if (column == 0) // File { text = Path.GetFileName(_movieList[index].Filename); @@ -108,7 +108,7 @@ namespace BizHawk.Client.EmuHawk } _sortReverse = false; - _sortedCol = string.Empty; + _sortedCol = ""; return index; } @@ -155,7 +155,7 @@ namespace BizHawk.Client.EmuHawk { MovieView.Refresh(); MovieCount.Text = _movieList.Count + " movie" - + (_movieList.Count != 1 ? "s" : string.Empty); + + (_movieList.Count != 1 ? "s" : ""); } private void PreHighlightMovie() @@ -443,7 +443,7 @@ namespace BizHawk.Client.EmuHawk private void MovieView_SelectedIndexChanged(object sender, EventArgs e) { - toolTip1.SetToolTip(DetailsView, string.Empty); + toolTip1.SetToolTip(DetailsView, ""); DetailsView.Items.Clear(); if (MovieView.SelectedIndices.Count < 1) { diff --git a/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs b/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs index bcdcf9a272..c2fc954211 100644 --- a/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs +++ b/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs @@ -16,7 +16,7 @@ namespace BizHawk.Client.EmuHawk { private const string DialogTitle = "Basic Bot"; - private string _currentFileName = string.Empty; + private string _currentFileName = ""; private string CurrentFileName { @@ -47,7 +47,7 @@ namespace BizHawk.Client.EmuHawk private BotAttempt _comparisonBotAttempt = null; private bool _replayMode = false; private int _startFrame = 0; - private string _lastRom = string.Empty; + private string _lastRom = ""; private bool _dontUpdateValues = false; @@ -345,7 +345,7 @@ namespace BizHawk.Client.EmuHawk { return StartFromSlotBox.SelectedItem != null ? StartFromSlotBox.SelectedItem.ToString() - : string.Empty; + : ""; } set @@ -435,7 +435,7 @@ namespace BizHawk.Client.EmuHawk private void NewMenuItem_Click(object sender, EventArgs e) { - CurrentFileName = string.Empty; + CurrentFileName = ""; _bestBotAttempt = null; ControlProbabilityPanel.Controls @@ -1021,12 +1021,12 @@ namespace BizHawk.Client.EmuHawk else { ClearBestButton.Enabled = false; - BestAttemptNumberLabel.Text = string.Empty; - BestMaximizeBox.Text = string.Empty; - BestTieBreak1Box.Text = string.Empty; - BestTieBreak2Box.Text = string.Empty; - BestTieBreak3Box.Text = string.Empty; - BestAttemptLogLabel.Text = string.Empty; + BestAttemptNumberLabel.Text = ""; + BestMaximizeBox.Text = ""; + BestTieBreak1Box.Text = ""; + BestTieBreak2Box.Text = ""; + BestTieBreak3Box.Text = ""; + BestAttemptLogLabel.Text = ""; PlayBestButton.Enabled = false; } } diff --git a/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs b/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs index 746f423e42..5257f36c81 100644 --- a/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs +++ b/BizHawk.Client.EmuHawk/tools/Cheats/CheatEdit.cs @@ -79,14 +79,14 @@ namespace BizHawk.Client.EmuHawk ValueHexIndLabel.Text = CompareHexIndLabel.Text = - _cheat.Type == DisplayType.Hex ? HexInd : string.Empty; + _cheat.Type == DisplayType.Hex ? HexInd : ""; BigEndianCheckBox.Checked = _cheat.BigEndian.Value; NameBox.Text = _cheat.Name; AddressBox.Text = _cheat.AddressStr; ValueBox.Text = _cheat.ValueStr; - CompareBox.Text = _cheat.Compare.HasValue ? _cheat.CompareStr : String.Empty; + CompareBox.Text = _cheat.Compare.HasValue ? _cheat.CompareStr : ""; if (_cheat.ComparisonType.Equals(Cheat.COMPARISONTYPE.NONE)) { @@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk CheckFormState(); if (!_cheat.Compare.HasValue) { - CompareBox.Text = String.Empty; // Necessary hack until WatchValueBox.ToRawInt() becomes nullable + CompareBox.Text = ""; // Necessary hack until WatchValueBox.ToRawInt() becomes nullable } _loading = false; @@ -113,7 +113,7 @@ namespace BizHawk.Client.EmuHawk SetSizeSelected(WatchSize.Byte); PopulateTypeDropdown(); - NameBox.Text = string.Empty; + NameBox.Text = ""; if (MemoryDomains != null) { @@ -140,7 +140,7 @@ namespace BizHawk.Client.EmuHawk SetTypeSelected(DisplayType.Hex); CheckFormState(); - CompareBox.Text = string.Empty; // TODO: A needed hack until WatchValueBox.ToRawInt() becomes nullable + CompareBox.Text = ""; // TODO: A needed hack until WatchValueBox.ToRawInt() becomes nullable _loading = false; } diff --git a/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs b/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs index 682c6808d4..9bc8bf67e5 100644 --- a/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs +++ b/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs @@ -29,7 +29,7 @@ namespace BizHawk.Client.EmuHawk private int _defaultWidth; private int _defaultHeight; - private string _sortedColumn = string.Empty; + private string _sortedColumn = ""; private bool _sortReverse; public Cheats() @@ -46,7 +46,7 @@ namespace BizHawk.Client.EmuHawk CheatListView.QueryItemBkColor += CheatListView_QueryItemBkColor; CheatListView.VirtualMode = true; - _sortedColumn = string.Empty; + _sortedColumn = ""; _sortReverse = false; } @@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk { MessageLabel.Text = saved ? Path.GetFileName(Global.CheatList.CurrentFileName) + " saved." - : Path.GetFileName(Global.CheatList.CurrentFileName) + (Global.CheatList.Changes ? " *" : string.Empty); + : Path.GetFileName(Global.CheatList.CurrentFileName) + (Global.CheatList.Changes ? " *" : ""); } public bool AskSaveChanges() @@ -234,7 +234,7 @@ namespace BizHawk.Client.EmuHawk private void CheatListView_QueryItemText(int index, int column, out string text) { - text = string.Empty; + text = ""; if (index >= Global.CheatList.Count || Global.CheatList[index].IsSeparator) { return; @@ -257,7 +257,7 @@ namespace BizHawk.Client.EmuHawk text = Global.CheatList[index].CompareStr; break; case ON: - text = Global.CheatList[index].Enabled ? "*" : string.Empty; + text = Global.CheatList[index].Enabled ? "*" : ""; break; case DOMAIN: text = Global.CheatList[index].Domain.Name; diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs b/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs index 31271639f2..cc3fca90a3 100644 --- a/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs +++ b/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs @@ -39,7 +39,7 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger private void BreakPointView_QueryItemText(int index, int column, out string text) { - text = string.Empty; + text = ""; switch (column) { case 0: diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs index 6135913c9b..4c6f1ff97c 100644 --- a/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs +++ b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs @@ -122,7 +122,7 @@ namespace BizHawk.Client.EmuHawk else { SeekToBox.Nullable = true; - SeekToBox.Text = string.Empty; + SeekToBox.Text = ""; } StepIntoMenuItem.Enabled = StepIntoBtn.Enabled = CanStepInto; diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs b/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs index 6d3b70f058..c6e1b57bc8 100644 --- a/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs +++ b/BizHawk.Client.EmuHawk/tools/Debugger/RegisterBoxControl.cs @@ -181,7 +181,7 @@ namespace BizHawk.Client.EmuHawk { try { - if (t.Text != String.Empty) + if (t.Text != "") { Core.SetCpuRegister(t.Name, int.Parse(t.Text, System.Globalization.NumberStyles.HexNumber)); } diff --git a/BizHawk.Client.EmuHawk/tools/GB/GBGameGenie.cs b/BizHawk.Client.EmuHawk/tools/GB/GBGameGenie.cs index f6faf6ae52..067ce4579f 100644 --- a/BizHawk.Client.EmuHawk/tools/GB/GBGameGenie.cs +++ b/BizHawk.Client.EmuHawk/tools/GB/GBGameGenie.cs @@ -143,7 +143,7 @@ namespace BizHawk.Client.EmuHawk private string GBGGEncode(int val, int add, int cmp) { char[] letters = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; - string code = string.Empty; + string code = ""; int[] num = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; num[0] = (val & 0xF0) >> 4; num[1] = val & 0x0F; @@ -259,10 +259,10 @@ namespace BizHawk.Client.EmuHawk private void ClearButton_Click(object sender, EventArgs e) { - AddressBox.Text = string.Empty; - ValueBox.Text = string.Empty; - CompareBox.Text = string.Empty; - GGCodeMaskBox.Text = string.Empty; + AddressBox.Text = ""; + ValueBox.Text = ""; + CompareBox.Text = ""; + GGCodeMaskBox.Text = ""; addcheatbt.Enabled = false; } @@ -275,7 +275,7 @@ namespace BizHawk.Client.EmuHawk // remove invalid character when pasted if (Regex.IsMatch(CompareBox.Text, @"[^a-fA-F0-9]")) { - CompareBox.Text = Regex.Replace(CompareBox.Text, @"[^a-fA-F0-9]", string.Empty); + CompareBox.Text = Regex.Replace(CompareBox.Text, @"[^a-fA-F0-9]", ""); } if ((CompareBox.Text.Length == 2) || (CompareBox.Text.Length == 0)) @@ -305,7 +305,7 @@ namespace BizHawk.Client.EmuHawk } else { - GGCodeMaskBox.Text = string.Empty; + GGCodeMaskBox.Text = ""; addcheatbt.Enabled = false; } } @@ -323,7 +323,7 @@ namespace BizHawk.Client.EmuHawk // remove invalid character when pasted if (Regex.IsMatch(ValueBox.Text, @"[^a-fA-F0-9]")) { - ValueBox.Text = Regex.Replace(ValueBox.Text, @"[^a-fA-F0-9]", string.Empty); + ValueBox.Text = Regex.Replace(ValueBox.Text, @"[^a-fA-F0-9]", ""); } if ((AddressBox.Text.Length > 0) || (ValueBox.Text.Length > 0)) @@ -351,7 +351,7 @@ namespace BizHawk.Client.EmuHawk } else { - GGCodeMaskBox.Text = string.Empty; + GGCodeMaskBox.Text = ""; addcheatbt.Enabled = false; } @@ -367,7 +367,7 @@ namespace BizHawk.Client.EmuHawk _processing = true; if (Regex.IsMatch(AddressBox.Text, @"[^a-fA-F0-9]")) { - AddressBox.Text = Regex.Replace(AddressBox.Text, @"[^a-fA-F0-9]", string.Empty); + AddressBox.Text = Regex.Replace(AddressBox.Text, @"[^a-fA-F0-9]", ""); } if ((AddressBox.Text.Length > 0) || (ValueBox.Text.Length > 0)) @@ -396,7 +396,7 @@ namespace BizHawk.Client.EmuHawk } else { - GGCodeMaskBox.Text = string.Empty; + GGCodeMaskBox.Text = ""; addcheatbt.Enabled = false; } @@ -408,7 +408,7 @@ namespace BizHawk.Client.EmuHawk { if (GGCodeMaskBox.Text.Length < 9) { - var code = string.Empty; + var code = ""; if (sender == B0) { code = "0"; } else if (sender == B1) { code = "1"; } @@ -447,7 +447,7 @@ namespace BizHawk.Client.EmuHawk // insert REGEX Remove non HEXA char if (Regex.IsMatch(GGCodeMaskBox.Text, @"[^a-fA-F0-9]")) { - GGCodeMaskBox.Text = Regex.Replace(GGCodeMaskBox.Text, @"[^a-fA-F0-9]", string.Empty); + GGCodeMaskBox.Text = Regex.Replace(GGCodeMaskBox.Text, @"[^a-fA-F0-9]", ""); } if (GGCodeMaskBox.Text.Length > 0) @@ -472,16 +472,16 @@ namespace BizHawk.Client.EmuHawk } else { - CompareBox.Text = string.Empty; + CompareBox.Text = ""; } addcheatbt.Enabled = true; } else { - AddressBox.Text = string.Empty; - ValueBox.Text = string.Empty; - CompareBox.Text = string.Empty; + AddressBox.Text = ""; + ValueBox.Text = ""; + CompareBox.Text = ""; addcheatbt.Enabled = false; } diff --git a/BizHawk.Client.EmuHawk/tools/Genesis/GenGameGenie.cs b/BizHawk.Client.EmuHawk/tools/Genesis/GenGameGenie.cs index 3f68a60751..c5fbb00465 100644 --- a/BizHawk.Client.EmuHawk/tools/Genesis/GenGameGenie.cs +++ b/BizHawk.Client.EmuHawk/tools/Genesis/GenGameGenie.cs @@ -177,10 +177,10 @@ namespace BizHawk.Client.EmuHawk _processing = true; // remove Invalid I O Q P if pasted - GGCodeMaskBox.Text = GGCodeMaskBox.Text.Replace("I", string.Empty); - GGCodeMaskBox.Text = GGCodeMaskBox.Text.Replace("O", string.Empty); - GGCodeMaskBox.Text = GGCodeMaskBox.Text.Replace("Q", string.Empty); - GGCodeMaskBox.Text = GGCodeMaskBox.Text.Replace("U", string.Empty); + GGCodeMaskBox.Text = GGCodeMaskBox.Text.Replace("I", ""); + GGCodeMaskBox.Text = GGCodeMaskBox.Text.Replace("O", ""); + GGCodeMaskBox.Text = GGCodeMaskBox.Text.Replace("Q", ""); + GGCodeMaskBox.Text = GGCodeMaskBox.Text.Replace("U", ""); if (GGCodeMaskBox.Text.Length > 0) { @@ -193,8 +193,8 @@ namespace BizHawk.Client.EmuHawk } else { - AddressBox.Text = string.Empty; - ValueBox.Text = string.Empty; + AddressBox.Text = ""; + ValueBox.Text = ""; AddCheatButton.Enabled = false; } @@ -210,7 +210,7 @@ namespace BizHawk.Client.EmuHawk _processing = true; if (Regex.IsMatch(AddressBox.Text, @"[^a-fA-F0-9]")) { - AddressBox.Text = Regex.Replace(AddressBox.Text, @"[^a-fA-F0-9]", string.Empty); + AddressBox.Text = Regex.Replace(AddressBox.Text, @"[^a-fA-F0-9]", ""); } if ((AddressBox.Text.Length > 0) || (ValueBox.Text.Length > 0)) @@ -232,7 +232,7 @@ namespace BizHawk.Client.EmuHawk } else { - GGCodeMaskBox.Text = string.Empty; + GGCodeMaskBox.Text = ""; AddCheatButton.Enabled = false; } @@ -249,7 +249,7 @@ namespace BizHawk.Client.EmuHawk // remove invalid character when pasted if (Regex.IsMatch(ValueBox.Text, @"[^a-fA-F0-9]")) { - ValueBox.Text = Regex.Replace(ValueBox.Text, @"[^a-fA-F0-9]", string.Empty); + ValueBox.Text = Regex.Replace(ValueBox.Text, @"[^a-fA-F0-9]", ""); } if ((AddressBox.Text.Length > 0) || (ValueBox.Text.Length > 0)) @@ -271,7 +271,7 @@ namespace BizHawk.Client.EmuHawk } else { - GGCodeMaskBox.Text = string.Empty; + GGCodeMaskBox.Text = ""; AddCheatButton.Enabled = false; } @@ -281,9 +281,9 @@ namespace BizHawk.Client.EmuHawk private void ClearButton_Click(object sender, EventArgs e) { - AddressBox.Text = string.Empty; - ValueBox.Text = string.Empty; - GGCodeMaskBox.Text = string.Empty; + AddressBox.Text = ""; + ValueBox.Text = ""; + GGCodeMaskBox.Text = ""; AddCheatButton.Enabled = false; } diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs index 6d5af3b224..12010313ce 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs @@ -73,7 +73,7 @@ namespace BizHawk.Client.EmuHawk private long _row; private long _addr; - private string _findStr = string.Empty; + private string _findStr = ""; private bool _mouseIsDown; private byte[] _rom; private MemoryDomain _romDomain; @@ -159,7 +159,7 @@ namespace BizHawk.Client.EmuHawk // Do nothing } - private string _lastRom = string.Empty; + private string _lastRom = ""; public void Restart() { @@ -234,7 +234,7 @@ namespace BizHawk.Client.EmuHawk { long found = -1; - var search = value.Replace(" ", string.Empty).ToUpper(); + var search = value.Replace(" ", "").ToUpper(); if (string.IsNullOrEmpty(search)) { return; @@ -290,7 +290,7 @@ namespace BizHawk.Client.EmuHawk { long found = -1; - var search = value.Replace(" ", string.Empty).ToUpper(); + var search = value.Replace(" ", "").ToUpper(); if (string.IsNullOrEmpty(search)) { return; @@ -755,11 +755,11 @@ namespace BizHawk.Client.EmuHawk { default: case 1: - return Watch.GenerateWatch(_domain, address, WatchSize.Byte, Client.Common.DisplayType.Hex, BigEndian, string.Empty); + return Watch.GenerateWatch(_domain, address, WatchSize.Byte, Client.Common.DisplayType.Hex, BigEndian, ""); case 2: - return Watch.GenerateWatch(_domain, address, WatchSize.Word, Client.Common.DisplayType.Hex, BigEndian, string.Empty); + return Watch.GenerateWatch(_domain, address, WatchSize.Word, Client.Common.DisplayType.Hex, BigEndian, ""); case 4: - return Watch.GenerateWatch(_domain, address, WatchSize.DWord, Client.Common.DisplayType.Hex, BigEndian, string.Empty); + return Watch.GenerateWatch(_domain, address, WatchSize.DWord, Client.Common.DisplayType.Hex, BigEndian, ""); } } @@ -910,7 +910,7 @@ namespace BizHawk.Client.EmuHawk var result = sfd.ShowHawkDialog(); - return result == DialogResult.OK ? sfd.FileName : string.Empty; + return result == DialogResult.OK ? sfd.FileName : ""; } private string GetSaveFileFromUser() @@ -933,7 +933,7 @@ namespace BizHawk.Client.EmuHawk var result = sfd.ShowHawkDialog(); - return result == DialogResult.OK ? sfd.FileName : string.Empty; + return result == DialogResult.OK ? sfd.FileName : ""; } private void ResetScrollBar() @@ -1069,7 +1069,7 @@ namespace BizHawk.Client.EmuHawk private string MakeNibbles() { - var str = string.Empty; + var str = ""; for (var x = 0; x < (DataSize * 2); x++) { if (_nibbles[x] != 'G') @@ -1181,7 +1181,7 @@ namespace BizHawk.Client.EmuHawk return string.Format(_digitFormatString, MakeValue(address)).Trim(); } - return string.Empty; + return ""; } private string GetFindValues() @@ -1192,7 +1192,7 @@ namespace BizHawk.Client.EmuHawk return _secondaryHighlightedAddresses.Aggregate(values, (current, x) => current + ValueString(x)); } - return string.Empty; + return ""; } private void HighlightSecondaries(string value, long found) @@ -2305,7 +2305,7 @@ namespace BizHawk.Client.EmuHawk else { _secondaryHighlightedAddresses.Clear(); - _findStr = string.Empty; + _findStr = ""; SetHighlighted(pointedAddress); } diff --git a/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs b/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs index 1908c16cd4..5716b5f43e 100644 --- a/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs +++ b/BizHawk.Client.EmuHawk/tools/HexEditor/HexFind.cs @@ -19,7 +19,7 @@ namespace BizHawk.Client.EmuHawk public string InitialValue { get { return FindBox.Text; } - set { FindBox.Text = value ?? string.Empty; } + set { FindBox.Text = value ?? ""; } } private void HexFind_Load(object sender, EventArgs e) @@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk { if (string.IsNullOrWhiteSpace(FindBox.Text)) { - return string.Empty; + return ""; } if (HexRadio.Checked) diff --git a/BizHawk.Client.EmuHawk/tools/InputPrompt.cs b/BizHawk.Client.EmuHawk/tools/InputPrompt.cs index 18663316c8..522c35486d 100644 --- a/BizHawk.Client.EmuHawk/tools/InputPrompt.cs +++ b/BizHawk.Client.EmuHawk/tools/InputPrompt.cs @@ -34,7 +34,7 @@ namespace BizHawk.Client.EmuHawk set { - PromptLabel.Text = value ?? string.Empty; + PromptLabel.Text = value ?? ""; Height += PromptLabel.Font.Height * Message.Count(x => x == '\n'); } } @@ -42,12 +42,12 @@ namespace BizHawk.Client.EmuHawk public string InitialValue { get { return PromptBox.Text; } - set { PromptBox.Text = value ?? string.Empty; } + set { PromptBox.Text = value ?? ""; } } public string PromptText { - get { return PromptBox.Text ?? string.Empty; } + get { return PromptBox.Text ?? ""; } } private void InputPrompt_Load(object sender, EventArgs e) diff --git a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Console.cs b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Console.cs index 1ded1ae240..a513831505 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Console.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Console.cs @@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk )] public static void Write(params object[] outputs) { - LogWithSeparator(string.Empty, string.Empty, outputs); + LogWithSeparator("", "", outputs); } // Outputs the given object to the output box on the Lua Console dialog. Note: Can accept a LuaTable diff --git a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Forms.cs b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Forms.cs index 9b3fe5f050..609a9722ca 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Forms.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Forms.cs @@ -56,7 +56,7 @@ namespace BizHawk.Client.EmuHawk private static void SetText(Control control, string caption) { - control.Text = caption ?? string.Empty; + control.Text = caption ?? ""; } #endregion @@ -263,7 +263,7 @@ namespace BizHawk.Client.EmuHawk ConsoleLuaLibrary.Log(ex.Message); } - return string.Empty; + return ""; } [LuaMethodAttributes( @@ -301,7 +301,7 @@ namespace BizHawk.Client.EmuHawk ConsoleLuaLibrary.Log(ex.Message); } - return string.Empty; + return ""; } [LuaMethodAttributes( @@ -442,7 +442,7 @@ namespace BizHawk.Client.EmuHawk return openFileDialog1.FileName; } - return string.Empty; + return ""; } [LuaMethodAttributes( diff --git a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Tastudio.cs b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Tastudio.cs index 7c24167ff7..a678679a7a 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Tastudio.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Tastudio.cs @@ -96,7 +96,7 @@ namespace BizHawk.Client.EmuHawk } } - return string.Empty; + return ""; } [LuaMethodAttributes( diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index f21b947c49..0c1d712381 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -51,7 +51,7 @@ namespace BizHawk.Client.EmuHawk { Settings = new LuaConsoleSettings(); _sortReverse = false; - _lastColumnSorted = string.Empty; + _lastColumnSorted = ""; _luaList = new LuaFileList { ChangedCallback = SessionChangedCallback, @@ -243,7 +243,7 @@ namespace BizHawk.Client.EmuHawk if (LuaAlreadyInSession(processedPath) == false) { - var luaFile = new LuaFile(string.Empty, processedPath); + var luaFile = new LuaFile("", processedPath); _luaList.Add(luaFile); LuaListView.ItemCount = _luaList.Count; @@ -336,7 +336,7 @@ namespace BizHawk.Client.EmuHawk private void SessionChangedCallback() { OutputMessages.Text = - (_luaList.Changes ? "* " : string.Empty) + + (_luaList.Changes ? "* " : "") + Path.GetFileName(_luaList.Filename); } @@ -378,7 +378,7 @@ namespace BizHawk.Client.EmuHawk private void LuaListView_QueryItemText(int index, int column, out string text) { - text = string.Empty; + text = ""; if (column == 0) { text = Path.GetFileNameWithoutExtension(_luaList[index].Path); // TODO: how about allow the user to name scripts? @@ -393,7 +393,7 @@ namespace BizHawk.Client.EmuHawk { if (path.StartsWith(".\\")) { - return path.Replace(".\\", string.Empty); + return path.Replace(".\\", ""); } return path; @@ -427,7 +427,7 @@ namespace BizHawk.Client.EmuHawk private void UpdateNumberOfScripts() { - var message = string.Empty; + var message = ""; var total = SelectedFiles.Count(); var active = _luaList.Count(file => file.Enabled); var paused = _luaList.Count(file => file.Enabled && file.Paused); @@ -482,7 +482,7 @@ namespace BizHawk.Client.EmuHawk OutputBox.Invoke(() => { - OutputBox.Text = string.Empty; + OutputBox.Text = ""; OutputBox.Refresh(); }); } @@ -1302,7 +1302,7 @@ namespace BizHawk.Client.EmuHawk for (var i = 0; i < _luaList.Count; i++) { _luaList[i] = luaListTemp[i]; - _luaList[i].Name = string.Empty; + _luaList[i].Name = ""; } UpdateDialog(); diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs index f318f484de..727f73a231 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaFunctionsForm.cs @@ -57,7 +57,7 @@ namespace BizHawk.Client.EmuHawk private void FunctionView_QueryItemText(int index, int column, out string text) { - text = string.Empty; + text = ""; try { diff --git a/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs b/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs index 4ca6bfabda..3fd91b271c 100644 --- a/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs +++ b/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs @@ -236,7 +236,7 @@ namespace BizHawk.Client.EmuHawk private static string ConvertToTag(string name) { - return new Regex("[^A-Za-z0-9]").Replace(name, string.Empty); + return new Regex("[^A-Za-z0-9]").Replace(name, ""); } private void NameBox_TextChanged(object sender, EventArgs e) @@ -246,7 +246,7 @@ namespace BizHawk.Client.EmuHawk private void BrowseBtn_Click(object sender, EventArgs e) { - string filename = string.Empty; + string filename = ""; string initialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MultiDiskBundlesFragment, "Global_NULL"); if (!Global.Game.IsNullInstance) diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs b/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs index 207aa4a542..dca9185bc8 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs @@ -129,7 +129,7 @@ namespace BizHawk.Client.EmuHawk AddressBox.Text = CompareBox.Text = ValueBox.Text = - string.Empty; + ""; AddCheat.Enabled = false; } @@ -174,7 +174,7 @@ namespace BizHawk.Client.EmuHawk private void ClearButton_Click(object sender, EventArgs e) { ClearProperties(); - GameGenieCode.Text = string.Empty; + GameGenieCode.Text = ""; Encoding.Checked = false; } @@ -231,7 +231,7 @@ namespace BizHawk.Client.EmuHawk { if (GameGenieCode.Text.Length < 8) { - var code = string.Empty; + var code = ""; if (sender == A) code = "A"; if (sender == P) code += "P"; if (sender == Z) code += "Z"; diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs b/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs index e705b63745..2726410475 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs @@ -341,11 +341,11 @@ namespace BizHawk.Client.EmuHawk private void NameTableView_MouseLeave(object sender, EventArgs e) { - XYLabel.Text = string.Empty; - PPUAddressLabel.Text = string.Empty; - TileIDLabel.Text = string.Empty; - TableLabel.Text = string.Empty; - PaletteLabel.Text = string.Empty; + XYLabel.Text = ""; + PPUAddressLabel.Text = ""; + TileIDLabel.Text = ""; + TableLabel.Text = ""; + PaletteLabel.Text = ""; } #endregion diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs b/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs index d9afd6335f..b7092b59b7 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs @@ -282,12 +282,12 @@ namespace BizHawk.Client.EmuHawk private void ClearDetails() { DetailsBox.Text = "Details"; - AddressLabel.Text = string.Empty; - ValueLabel.Text = string.Empty; - Value2Label.Text = string.Empty; - Value3Label.Text = string.Empty; - Value4Label.Text = string.Empty; - Value5Label.Text = string.Empty; + AddressLabel.Text = ""; + ValueLabel.Text = ""; + Value2Label.Text = ""; + Value3Label.Text = ""; + Value4Label.Text = ""; + Value5Label.Text = ""; ZoomBox.Image = _zoomBoxDefaultImage; } diff --git a/BizHawk.Client.EmuHawk/tools/SNES/SNESGameGenie.cs b/BizHawk.Client.EmuHawk/tools/SNES/SNESGameGenie.cs index 6635ecac01..7d94ecefb1 100644 --- a/BizHawk.Client.EmuHawk/tools/SNES/SNESGameGenie.cs +++ b/BizHawk.Client.EmuHawk/tools/SNES/SNESGameGenie.cs @@ -152,7 +152,7 @@ namespace BizHawk.Client.EmuHawk // maps to| Value |i|j|k|l|q|r|s|t|o|p|a|b|c|d|u|v|w|x|e|f|g|h|m|n| // order | Value |a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x| char[] letters = { 'D', 'F', '4', '7', '0', '9', '1', '5', '6', 'B', 'C', '8', 'A', '2', '3', 'E' }; - var code = string.Empty; + var code = ""; int[] num = { 0, 0, 0, 0, 0, 0, 0, 0 }; num[0] = (val & 0xF0) >> 4; num[1] = val & 0x0F; @@ -176,9 +176,9 @@ namespace BizHawk.Client.EmuHawk private void ClearButton_Click(object sender, EventArgs e) { - AddressBox.Text = string.Empty; - ValueBox.Text = string.Empty; - GGCodeMaskBox.Text = string.Empty; + AddressBox.Text = ""; + ValueBox.Text = ""; + GGCodeMaskBox.Text = ""; addcheatbt.Enabled = false; } @@ -235,7 +235,7 @@ namespace BizHawk.Client.EmuHawk _processing = true; if (Regex.IsMatch(AddressBox.Text, @"[^a-fA-F0-9]")) { - AddressBox.Text = Regex.Replace(AddressBox.Text, @"[^a-fA-F0-9]", string.Empty); + AddressBox.Text = Regex.Replace(AddressBox.Text, @"[^a-fA-F0-9]", ""); } if (!string.IsNullOrEmpty(AddressBox.Text) || !string.IsNullOrEmpty(ValueBox.Text)) @@ -256,7 +256,7 @@ namespace BizHawk.Client.EmuHawk } else { - GGCodeMaskBox.Text = string.Empty; + GGCodeMaskBox.Text = ""; addcheatbt.Enabled = false; } @@ -273,7 +273,7 @@ namespace BizHawk.Client.EmuHawk // remove invalid character when pasted if (Regex.IsMatch(ValueBox.Text, @"[^a-fA-F0-9]")) { - ValueBox.Text = Regex.Replace(ValueBox.Text, @"[^a-fA-F0-9]", string.Empty); + ValueBox.Text = Regex.Replace(ValueBox.Text, @"[^a-fA-F0-9]", ""); } if ((AddressBox.Text.Length > 0) || (ValueBox.Text.Length > 0)) @@ -294,7 +294,7 @@ namespace BizHawk.Client.EmuHawk } else { - GGCodeMaskBox.Text = string.Empty; + GGCodeMaskBox.Text = ""; addcheatbt.Enabled = false; } @@ -311,7 +311,7 @@ namespace BizHawk.Client.EmuHawk // insert REGEX Remove non HEXA char if (Regex.IsMatch(GGCodeMaskBox.Text, @"[^a-fA-F0-9]")) { - GGCodeMaskBox.Text = Regex.Replace(GGCodeMaskBox.Text, @"[^a-fA-F0-9]", string.Empty); + GGCodeMaskBox.Text = Regex.Replace(GGCodeMaskBox.Text, @"[^a-fA-F0-9]", ""); } if (GGCodeMaskBox.Text.Length > 0) @@ -324,8 +324,8 @@ namespace BizHawk.Client.EmuHawk } else { - AddressBox.Text = string.Empty; - ValueBox.Text = string.Empty; + AddressBox.Text = ""; + ValueBox.Text = ""; addcheatbt.Enabled = false; } @@ -337,7 +337,7 @@ namespace BizHawk.Client.EmuHawk { if (GGCodeMaskBox.Text.Length < 8) { - var code = string.Empty; + var code = ""; if (sender == B0) code = "0"; if (sender == B1) code = "1"; if (sender == B2) code = "2"; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs index 53fe70d8b4..41edaaf128 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs @@ -66,7 +66,7 @@ namespace BizHawk.Client.EmuHawk private void QueryItemText(int index, InputRoll.RollColumn column, out string text, ref int offsetX, ref int offsetY) { - text = string.Empty; + text = ""; if (index >= Movie.BranchCount) { diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index 3eb54be702..151509bd46 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -13,8 +13,8 @@ namespace BizHawk.Client.EmuHawk public partial class TAStudio { // Input Painting - private string _startBoolDrawColumn = string.Empty; - private string _startFloatDrawColumn = string.Empty; + private string _startBoolDrawColumn = ""; + private string _startFloatDrawColumn = ""; private bool _boolPaintState; private float _floatPaintState; private float _floatBackupState; @@ -25,7 +25,7 @@ namespace BizHawk.Client.EmuHawk private bool _supressContextMenu; // Editing analog input - private string _floatEditColumn = string.Empty; + private string _floatEditColumn = ""; private int _floatEditRow = -1; private string _floatTypedValue; private int _floatEditYPos = -1; @@ -265,7 +265,7 @@ namespace BizHawk.Client.EmuHawk try { - text = string.Empty; + text = ""; var columnName = column.Name; if (columnName == CursorColumnName) @@ -302,7 +302,7 @@ namespace BizHawk.Client.EmuHawk } catch (Exception ex) { - text = string.Empty; + text = ""; MessageBox.Show("oops\n" + ex); } } @@ -639,8 +639,8 @@ namespace BizHawk.Client.EmuHawk { _startCursorDrag = false; _startSelectionDrag = false; - _startBoolDrawColumn = string.Empty; - _startFloatDrawColumn = string.Empty; + _startBoolDrawColumn = ""; + _startFloatDrawColumn = ""; TasView.ReleaseCurrentCell(); // Exit float editing if value was changed with cursor if (FloatEditingMode && _floatPaintState != CurrentTasMovie.GetFloatState(_floatEditRow, _floatEditColumn)) @@ -756,7 +756,7 @@ namespace BizHawk.Client.EmuHawk { if (Settings.EmptyMarkers) { - CurrentTasMovie.Markers.Add(TasView.CurrentCell.RowIndex.Value, string.Empty); + CurrentTasMovie.Markers.Add(TasView.CurrentCell.RowIndex.Value, ""); RefreshDialog(); } else diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index c86792400b..c481901f6c 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -50,7 +50,7 @@ namespace BizHawk.Client.EmuHawk var filename = CurrentTasMovie.Filename; if (string.IsNullOrWhiteSpace(filename) || filename == DefaultTasProjName()) { - filename = string.Empty; + filename = ""; } // need to be fancy here, so call the ofd constructor directly instead of helper diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 586e66514d..d5e3f5a648 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -380,7 +380,7 @@ namespace BizHawk.Client.EmuHawk private void SetUpColumns() { TasView.AllColumns.Clear(); - AddColumn(CursorColumnName, string.Empty, 18); + AddColumn(CursorColumnName, "", 18); AddColumn(FrameColumnName, "Frame#", 68); var columnNames = GenerateColumnNames(); diff --git a/BizHawk.Client.EmuHawk/tools/ToolManager.cs b/BizHawk.Client.EmuHawk/tools/ToolManager.cs index ec17787ada..c45a1dd6b0 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolManager.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolManager.cs @@ -72,7 +72,7 @@ namespace BizHawk.Client.EmuHawk public T Load(bool focus = true) where T : class, IToolForm { - return Load(string.Empty, focus); + return Load("", focus); } /// diff --git a/BizHawk.Client.EmuHawk/tools/TraceLogger.cs b/BizHawk.Client.EmuHawk/tools/TraceLogger.cs index d38dce1cbe..27e95c9c3d 100644 --- a/BizHawk.Client.EmuHawk/tools/TraceLogger.cs +++ b/BizHawk.Client.EmuHawk/tools/TraceLogger.cs @@ -86,7 +86,7 @@ namespace BizHawk.Client.EmuHawk private void TraceView_QueryItemText(int index, int column, out string text) { - text = string.Empty; + text = ""; if (index < _instructions.Count) { switch (column) diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs index 03c8a01cfa..f4bbb50ebd 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/VirtualPadAnalogButton.cs @@ -9,7 +9,7 @@ namespace BizHawk.Client.EmuHawk { public partial class VirtualPadAnalogButton : UserControl, IVirtualPadControl { - private string _displayName = string.Empty; + private string _displayName = ""; private int _maxValue, _minValue; private bool _programmaticallyChangingValue; private bool _readonly; @@ -109,7 +109,7 @@ namespace BizHawk.Client.EmuHawk set { - _displayName = value ?? string.Empty; + _displayName = value ?? ""; if (DisplayNameLabel != null) { DisplayNameLabel.Text = _displayName; diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/components/AnalogSticklPanel.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/components/AnalogSticklPanel.cs index d045eccddd..38dc7833c8 100644 --- a/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/components/AnalogSticklPanel.cs +++ b/BizHawk.Client.EmuHawk/tools/VirtualPads/controls/components/AnalogSticklPanel.cs @@ -49,8 +49,8 @@ namespace BizHawk.Client.EmuHawk public bool HasValue = false; public bool ReadOnly { get; set; } - public string XName = string.Empty; - public string YName = string.Empty; + public string XName = ""; + public string YName = ""; private IController _previous = null; diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs index 680ae0fb7c..253ff2aabd 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamPoke.cs @@ -80,8 +80,8 @@ namespace BizHawk.Client.EmuHawk ValueBox.ByteSize = _watchList[0].Size; ValueBox.Type = _watchList[0].Type; - ValueHexLabel.Text = _watchList[0].Type == DisplayType.Hex ? "0x" : string.Empty; - ValueBox.Text = _watchList[0].ValueString.Replace(" ", string.Empty); + ValueHexLabel.Text = _watchList[0].Type == DisplayType.Hex ? "0x" : ""; + ValueBox.Text = _watchList[0].ValueString.Replace(" ", ""); DomainLabel.Text = _watchList[0].Domain.Name; SizeLabel.Text = _watchList[0].Size.ToString(); DisplayTypeLabel.Text = Watch.DisplayTypeToString(_watchList[0].Type); diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs index 58244e6f08..690acc99e2 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs @@ -27,14 +27,14 @@ namespace BizHawk.Client.EmuHawk public partial class RamSearch : ToolFormBase, IToolForm { // TODO: DoSearch grabs the state of widgets and passes it to the engine before running, so rip out code that is attempting to keep the state up to date through change events - private string _currentFileName = string.Empty; + private string _currentFileName = ""; private RamSearchEngine _searches; private RamSearchEngine.Settings _settings; private int _defaultWidth; private int _defaultHeight; - private string _sortedColumn = string.Empty; + private string _sortedColumn = ""; private bool _sortReverse; private bool _forcePreviewClear; private bool _autoSearch; @@ -57,7 +57,7 @@ namespace BizHawk.Client.EmuHawk WatchListView.VirtualMode = true; Closing += (o, e) => SaveConfigSettings(); - _sortedColumn = string.Empty; + _sortedColumn = ""; _sortReverse = false; Settings = new RamSearchSettings(); @@ -132,7 +132,7 @@ namespace BizHawk.Client.EmuHawk DifferentByBox.Type = Common.DisplayType.Unsigned; DifferenceBox.Type = Common.DisplayType.Unsigned; - MessageLabel.Text = string.Empty; + MessageLabel.Text = ""; SpecificAddressBox.MaxLength = (MemoryDomains.MainMemory.Size - 1).NumHexDigits(); HardSetSizeDropDown(_settings.Size); PopulateTypeDropDown(); @@ -196,7 +196,7 @@ namespace BizHawk.Client.EmuHawk private void ListView_QueryItemText(int index, int column, out string text) { - text = string.Empty; + text = ""; if (index >= _searches.Count) { @@ -342,7 +342,7 @@ namespace BizHawk.Client.EmuHawk UpdateList(); ToggleSearchDependentToolBarItems(); SetReboot(false); - MessageLabel.Text = string.Empty; + MessageLabel.Text = ""; SetDomainLabel(); } @@ -566,7 +566,7 @@ namespace BizHawk.Client.EmuHawk private void SetRemovedMessage(int val) { - MessageLabel.Text = val + " address" + (val != 1 ? "es" : string.Empty) + " removed"; + MessageLabel.Text = val + " address" + (val != 1 ? "es" : "") + " removed"; } private void SetTotal() @@ -698,8 +698,8 @@ namespace BizHawk.Client.EmuHawk private void PopulateTypeDropDown() { - var previous = DisplayTypeDropdown.SelectedItem?.ToString() ?? string.Empty; - var next = string.Empty; + var previous = DisplayTypeDropdown.SelectedItem?.ToString() ?? ""; + var next = ""; DisplayTypeDropdown.Items.Clear(); @@ -787,7 +787,7 @@ namespace BizHawk.Client.EmuHawk NumberOfChangesRadio.Enabled = false; NumberOfChangesBox.Enabled = false; - NumberOfChangesBox.Text = string.Empty; + NumberOfChangesBox.Text = ""; ClearChangeCountsToolBarItem.Enabled = false; if (NumberOfChangesRadio.Checked || DifferenceRadio.Checked) @@ -903,7 +903,7 @@ namespace BizHawk.Client.EmuHawk switch (name) { default: - return string.Empty; + return ""; case WatchList.ADDRESS: return _searches[index].AddressString; case WatchList.VALUE: @@ -995,7 +995,7 @@ namespace BizHawk.Client.EmuHawk private void OpenMenuItem_Click(object sender, EventArgs e) { LoadWatchFile( - GetWatchFileFromUser(string.Empty), + GetWatchFileFromUser(""), sender == AppendFileMenuItem, sender == TruncateFromFileMenuItem); } @@ -1246,7 +1246,7 @@ namespace BizHawk.Client.EmuHawk ToggleSearchDependentToolBarItems(); _forcePreviewClear = true; UpdateUndoToolBarButtons(); - MessageLabel.Text = restoredCount + " address" + (restoredCount != 1 ? "es" : string.Empty) + " restored"; + MessageLabel.Text = restoredCount + " address" + (restoredCount != 1 ? "es" : "") + " restored"; } } @@ -1259,7 +1259,7 @@ namespace BizHawk.Client.EmuHawk ToggleSearchDependentToolBarItems(); _forcePreviewClear = true; UpdateUndoToolBarButtons(); - MessageLabel.Text = restoredCount + " address" + (restoredCount != 1 ? "es" : string.Empty) + " removed"; + MessageLabel.Text = restoredCount + " address" + (restoredCount != 1 ? "es" : "") + " removed"; } } diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index 9c62a13450..3382d14e04 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -22,7 +22,7 @@ namespace BizHawk.Client.EmuHawk private int _defaultWidth; private int _defaultHeight; - private string _sortedColumn = string.Empty; + private string _sortedColumn = ""; private bool _sortReverse; private bool _paused; @@ -55,7 +55,7 @@ namespace BizHawk.Client.EmuHawk } }; - _sortedColumn = string.Empty; + _sortedColumn = ""; _sortReverse = false; } @@ -433,7 +433,7 @@ namespace BizHawk.Client.EmuHawk switch (name) { default: - return string.Empty; + return ""; case WatchList.ADDRESS: return _watches[index].AddressString; case WatchList.VALUE: @@ -485,7 +485,7 @@ namespace BizHawk.Client.EmuHawk UpdateWatchCount(); UpdateStatusBar(); _sortReverse = false; - _sortedColumn = string.Empty; + _sortedColumn = ""; PokeAddressToolBarItem.Enabled = FreezeAddressToolBarItem.Enabled = @@ -540,7 +540,7 @@ namespace BizHawk.Client.EmuHawk private void UpdateStatusBar(bool saved = false) { - var message = string.Empty; + var message = ""; if (!string.IsNullOrWhiteSpace(_watches.CurrentFileName)) { if (saved) @@ -549,7 +549,7 @@ namespace BizHawk.Client.EmuHawk } else { - message = Path.GetFileName(_watches.CurrentFileName) + (_watches.Changes ? " *" : string.Empty); + message = Path.GetFileName(_watches.CurrentFileName) + (_watches.Changes ? " *" : ""); } } @@ -589,7 +589,7 @@ namespace BizHawk.Client.EmuHawk private void WatchListView_QueryItemText(int index, int column, out string text) { - text = string.Empty; + text = ""; if (index >= _watches.Count || _watches[index].IsSeparator) { @@ -1034,7 +1034,7 @@ namespace BizHawk.Client.EmuHawk SelectedWatches.Any() && _debuggable != null && _debuggable.MemoryCallbacksAvailable() && - SelectedWatches.All(w => w.Domain.Name == (_memoryDomains != null ? _memoryDomains.SystemBus.Name : string.Empty)); + SelectedWatches.All(w => w.Domain.Name == (_memoryDomains != null ? _memoryDomains.SystemBus.Name : "")); PokeContextMenuItem.Enabled = FreezeContextMenuItem.Visible = diff --git a/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs b/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs index e456671535..c64f671bac 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/WatchEditor.cs @@ -81,7 +81,7 @@ namespace BizHawk.Client.EmuHawk if (_watchList.Count > 1) { NotesBox.Enabled = false; - NotesBox.Text = string.Empty; + NotesBox.Text = ""; AddressBox.Enabled = false; AddressBox.Text = _watchList.Select(a => a.AddressString).Aggregate((addrStr, nextStr) => addrStr + ("," + nextStr)); @@ -132,7 +132,7 @@ namespace BizHawk.Client.EmuHawk Text = "New Watch"; break; case Mode.Edit: - Text = "Edit Watch" + (_watchList.Count > 1 ? "es" : string.Empty); + Text = "Edit Watch" + (_watchList.Count > 1 ? "es" : ""); break; case Mode.Duplicate: Text = "Duplicate Watch"; diff --git a/BizHawk.Client.EmuHawk/tools/Watch/WatchValueBox.cs b/BizHawk.Client.EmuHawk/tools/Watch/WatchValueBox.cs index 925334aa70..e5016cfd99 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/WatchValueBox.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/WatchValueBox.cs @@ -146,7 +146,7 @@ namespace BizHawk.Client.EmuHawk { if (Nullable) { - Text = string.Empty; + Text = ""; } else { @@ -452,7 +452,7 @@ namespace BizHawk.Client.EmuHawk var val = ToRawInt(); if (!val.HasValue) { - Text = string.Empty; + Text = ""; } else if (val == MinSignedInt) { @@ -725,7 +725,7 @@ namespace BizHawk.Client.EmuHawk } else { - Text = string.Empty; + Text = ""; } } } diff --git a/BizHawk.Client.MultiHawk/EmulatorWindow.cs b/BizHawk.Client.MultiHawk/EmulatorWindow.cs index ba20d5fa89..0ea193c46c 100644 --- a/BizHawk.Client.MultiHawk/EmulatorWindow.cs +++ b/BizHawk.Client.MultiHawk/EmulatorWindow.cs @@ -159,7 +159,7 @@ namespace BizHawk.Client.MultiHawk break; } - if (str.Trim() == string.Empty) + if (str.Trim() == "") { continue; } diff --git a/BizHawk.Client.MultiHawk/EmulatorWindowList.cs b/BizHawk.Client.MultiHawk/EmulatorWindowList.cs index 3e037d2398..1da78079a1 100644 --- a/BizHawk.Client.MultiHawk/EmulatorWindowList.cs +++ b/BizHawk.Client.MultiHawk/EmulatorWindowList.cs @@ -52,7 +52,7 @@ namespace BizHawk.Client.MultiHawk public new void Clear() { - SessionName = string.Empty; + SessionName = ""; base.Clear(); } diff --git a/BizHawk.Client.MultiHawk/movie/PlayMovie.cs b/BizHawk.Client.MultiHawk/movie/PlayMovie.cs index 0a0584ff93..9a99c3a31f 100644 --- a/BizHawk.Client.MultiHawk/movie/PlayMovie.cs +++ b/BizHawk.Client.MultiHawk/movie/PlayMovie.cs @@ -29,10 +29,10 @@ namespace BizHawk.Client.MultiHawk MovieView.QueryItemText += MovieView_QueryItemText; MovieView.VirtualMode = true; _sortReverse = false; - _sortedCol = string.Empty; + _sortedCol = ""; _sortDetailsReverse = false; - _sortedDetailsCol = string.Empty; + _sortedDetailsCol = ""; } private void PlayMovie_Load(object sender, EventArgs e) @@ -46,7 +46,7 @@ namespace BizHawk.Client.MultiHawk private void MovieView_QueryItemText(int index, int column, out string text) { - text = string.Empty; + text = ""; if (column == 0) // File { text = Path.GetFileName(_movieList[index].Filename); @@ -104,7 +104,7 @@ namespace BizHawk.Client.MultiHawk } _sortReverse = false; - _sortedCol = string.Empty; + _sortedCol = ""; } return index; @@ -153,7 +153,7 @@ namespace BizHawk.Client.MultiHawk { MovieView.Refresh(); MovieCount.Text = _movieList.Count + " movie" - + (_movieList.Count != 1 ? "s" : string.Empty); + + (_movieList.Count != 1 ? "s" : ""); } private void PreHighlightMovie() @@ -436,7 +436,7 @@ namespace BizHawk.Client.MultiHawk private void MovieView_SelectedIndexChanged(object sender, EventArgs e) { - toolTip1.SetToolTip(DetailsView, string.Empty); + toolTip1.SetToolTip(DetailsView, ""); DetailsView.Items.Clear(); if (MovieView.SelectedIndices.Count < 1) { diff --git a/BizHawk.Common/Extensions/BufferExtensions.cs b/BizHawk.Common/Extensions/BufferExtensions.cs index d48b3003ec..82f272d34a 100644 --- a/BizHawk.Common/Extensions/BufferExtensions.cs +++ b/BizHawk.Common/Extensions/BufferExtensions.cs @@ -98,7 +98,7 @@ namespace BizHawk.Common.BufferExtensions for (int i = 0; i < buffer.Length && i * 2 < hex.Length; i++) { - var bytehex = string.Empty + hex[i * 2] + hex[(i * 2) + 1]; + var bytehex = "" + hex[i * 2] + hex[(i * 2) + 1]; buffer[i] = byte.Parse(bytehex, NumberStyles.HexNumber); } } @@ -134,7 +134,7 @@ namespace BizHawk.Common.BufferExtensions for (int i = 0; i < buffer.Length && i * 4 < hex.Length; i++) { - var shorthex = string.Empty + hex[i * 4] + hex[(i * 4) + 1] + hex[(i * 4) + 2] + hex[(i * 4) + 3]; + var shorthex = "" + hex[i * 4] + hex[(i * 4) + 1] + hex[(i * 4) + 2] + hex[(i * 4) + 3]; buffer[i] = short.Parse(shorthex, NumberStyles.HexNumber); } } @@ -148,7 +148,7 @@ namespace BizHawk.Common.BufferExtensions for (int i = 0; i < buffer.Length && i * 4 < hex.Length; i++) { - var ushorthex = string.Empty + hex[i * 4] + hex[(i * 4) + 1] + hex[(i * 4) + 2] + hex[(i * 4) + 3]; + var ushorthex = "" + hex[i * 4] + hex[(i * 4) + 1] + hex[(i * 4) + 2] + hex[(i * 4) + 3]; buffer[i] = ushort.Parse(ushorthex, NumberStyles.HexNumber); } } diff --git a/BizHawk.Common/Extensions/ReflectionExtensions.cs b/BizHawk.Common/Extensions/ReflectionExtensions.cs index c727f31a96..29bdfafd92 100644 --- a/BizHawk.Common/Extensions/ReflectionExtensions.cs +++ b/BizHawk.Common/Extensions/ReflectionExtensions.cs @@ -68,7 +68,7 @@ namespace BizHawk.Common.ReflectionExtensions if (descriptions.Length == 0) { - return string.Empty; + return ""; } return descriptions[0].Description; diff --git a/BizHawk.Common/Extensions/StringExtensions.cs b/BizHawk.Common/Extensions/StringExtensions.cs index 1a2b3bcfed..aad03258be 100644 --- a/BizHawk.Common/Extensions/StringExtensions.cs +++ b/BizHawk.Common/Extensions/StringExtensions.cs @@ -18,7 +18,7 @@ namespace BizHawk.Common.StringExtensions if (index == 0) { - return string.Empty; + return ""; } return str.Substring(0, index); @@ -222,7 +222,7 @@ namespace BizHawk.Common.StringExtensions { if (string.IsNullOrWhiteSpace(raw)) { - return string.Empty; + return ""; } var output = new StringBuilder(); @@ -245,7 +245,7 @@ namespace BizHawk.Common.StringExtensions { if (string.IsNullOrWhiteSpace(raw)) { - return string.Empty; + return ""; } var output = new StringBuilder(); @@ -269,7 +269,7 @@ namespace BizHawk.Common.StringExtensions { if (string.IsNullOrWhiteSpace(raw)) { - return string.Empty; + return ""; } var output = new StringBuilder(); @@ -299,7 +299,7 @@ namespace BizHawk.Common.StringExtensions { if (string.IsNullOrWhiteSpace(raw)) { - return string.Empty; + return ""; } var output = new StringBuilder(raw.Length); @@ -323,7 +323,7 @@ namespace BizHawk.Common.StringExtensions { if (string.IsNullOrWhiteSpace(raw)) { - return string.Empty; + return ""; } var output = new StringBuilder(); @@ -358,7 +358,7 @@ namespace BizHawk.Common.StringExtensions { if (string.IsNullOrWhiteSpace(raw)) { - return string.Empty; + return ""; } var output = new StringBuilder(); diff --git a/BizHawk.Common/Serializer.cs b/BizHawk.Common/Serializer.cs index 48a74dadac..0a882f6f6c 100644 --- a/BizHawk.Common/Serializer.cs +++ b/BizHawk.Common/Serializer.cs @@ -1172,7 +1172,7 @@ namespace BizHawk.Common private sealed class Section : Dictionary { - public string Name = string.Empty; + public string Name = ""; public readonly Dictionary Items = new Dictionary(); } diff --git a/BizHawk.Common/Sprintf.cs b/BizHawk.Common/Sprintf.cs index b7cf82bd29..3a7eb397c2 100644 --- a/BizHawk.Common/Sprintf.cs +++ b/BizHawk.Common/Sprintf.cs @@ -261,7 +261,7 @@ namespace BizHawk.Common Regex r = new Regex( @"\%(\d*\$)?([\'\#\-\+ ]*)(\d*)(?:\.(\d+))?([hl])?([dioxXucsfeEgGpn%])" ); //"%[parameter][flags][width][.precision][length]type" Match m = null; - string w = String.Empty; + string w = ""; int defaultParamIx = 0; int paramIx; object o = null; @@ -392,7 +392,7 @@ namespace BizHawk.Common #endregion // convert value parameters to a string depending on the formatSpecifier - w = String.Empty; + w = ""; switch ( formatSpecifier ) { #region % - character @@ -454,7 +454,7 @@ namespace BizHawk.Common #endregion #region s - string case 's': // string - string t = "{0" + ( fieldLength != int.MinValue ? "," + ( flagLeft2Right ? "-" : String.Empty ) + fieldLength.ToString() : String.Empty ) + ":s}"; + string t = "{0" + ( fieldLength != int.MinValue ? "," + ( flagLeft2Right ? "-" : "" ) + fieldLength.ToString() : "" ) + ":s}"; if (n == IntPtr.Zero) w = "(null)"; else w = Marshal.PtrToStringAnsi(n); @@ -535,7 +535,7 @@ namespace BizHawk.Common break; #endregion default: - w = String.Empty; + w = ""; defaultParamIx++; break; } @@ -562,12 +562,12 @@ namespace BizHawk.Common bool Left2Right, char Padding, object Value ) { - string w = String.Empty; + string w = ""; string lengthFormat = "{0" + ( FieldLength != int.MinValue ? "," + ( Left2Right ? "-" : - String.Empty ) + FieldLength.ToString() : - String.Empty ) + "}"; + "" ) + FieldLength.ToString() : + "" ) + "}"; if ( IsNumericType( Value ) ) { @@ -597,15 +597,15 @@ namespace BizHawk.Common bool Left2Right, char Padding, object Value ) { - string w = String.Empty; + string w = ""; string lengthFormat = "{0" + ( FieldLength != int.MinValue ? "," + ( Left2Right ? "-" : - String.Empty ) + FieldLength.ToString() : - String.Empty ) + "}"; + "" ) + FieldLength.ToString() : + "" ) + "}"; string numberFormat = "{0:" + NativeFormat + ( FieldPrecision != int.MinValue ? FieldPrecision.ToString() : - String.Empty ) + "}"; + "" ) + "}"; if ( IsNumericType( Value ) ) { @@ -636,12 +636,12 @@ namespace BizHawk.Common bool PositiveSign, bool PositiveSpace, char Padding, object Value ) { - string w = String.Empty; + string w = ""; string lengthFormat = "{0" + ( FieldLength != int.MinValue ? "," + ( Left2Right ? "-" : - String.Empty ) + FieldLength.ToString() : - String.Empty ) + "}"; + "" ) + FieldLength.ToString() : + "" ) + "}"; string numberFormat = "{0:" + NativeFormat + ( FieldPrecision != int.MinValue ? FieldPrecision.ToString() : "0" ) + "}"; @@ -654,7 +654,7 @@ namespace BizHawk.Common { if ( IsPositive( Value, true ) ) w = ( PositiveSign ? - "+" : ( PositiveSpace ? " " : String.Empty ) ) + w; + "+" : ( PositiveSpace ? " " : "" ) ) + w; w = String.Format( lengthFormat, w ); } else @@ -667,7 +667,7 @@ namespace BizHawk.Common w = ( PositiveSign ? "+" : ( PositiveSpace ? " " : ( FieldLength != int.MinValue ? - Padding.ToString() : String.Empty ) ) ) + w; + Padding.ToString() : "" ) ) ) + w; else w = "-" + w; } diff --git a/BizHawk.Common/TempFileManager.cs b/BizHawk.Common/TempFileManager.cs index 4ba5e13522..14252983bf 100644 --- a/BizHawk.Common/TempFileManager.cs +++ b/BizHawk.Common/TempFileManager.cs @@ -17,7 +17,7 @@ namespace BizHawk.Common public static string GetTempFilename(string friendlyname, string extension = null, bool delete = true) { string guidPart = Guid.NewGuid().ToString(); - var fname = $"biz-{System.Diagnostics.Process.GetCurrentProcess().Id}-{friendlyname}-{guidPart}{extension ?? string.Empty}"; + var fname = $"biz-{System.Diagnostics.Process.GetCurrentProcess().Id}-{friendlyname}-{guidPart}{extension ?? ""}"; if (delete) { fname = RenameTempFilenameForDelete(fname); diff --git a/BizHawk.Emulation.Common/Database/Database.cs b/BizHawk.Emulation.Common/Database/Database.cs index b181d62a0a..c14f807f15 100644 --- a/BizHawk.Emulation.Common/Database/Database.cs +++ b/BizHawk.Emulation.Common/Database/Database.cs @@ -113,7 +113,7 @@ namespace BizHawk.Emulation.Common { while (reader.EndOfStream == false) { - var line = reader.ReadLine() ?? string.Empty; + var line = reader.ReadLine() ?? ""; try { if (line.StartsWith(";")) @@ -174,8 +174,8 @@ namespace BizHawk.Emulation.Common game.Name = items[2]; game.System = items[3]; game.MetaData = items.Length >= 6 ? items[5] : null; - game.Region = items.Length >= 7 ? items[6] : string.Empty; - game.ForcedCore = items.Length >= 8 ? items[7].ToLowerInvariant() : string.Empty; + game.Region = items.Length >= 7 ? items[6] : ""; + game.ForcedCore = items.Length >= 8 ? items[7].ToLowerInvariant() : ""; if (DB.ContainsKey(game.Hash)) { diff --git a/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs b/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs index 8309cbbdb6..d44bfc5368 100644 --- a/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs +++ b/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs @@ -272,7 +272,7 @@ namespace BizHawk.Emulation.Common private static void FirmwareAndOption(string hash, long size, string systemId, string id, string name, string descr) { Firmware(systemId, id, descr); - File(hash, size, name, descr, string.Empty); + File(hash, size, name, descr, ""); Option(hash, size, systemId, id); } diff --git a/BizHawk.Emulation.Common/Database/GameInfo.cs b/BizHawk.Emulation.Common/Database/GameInfo.cs index 6e033df873..ca6fab1b24 100644 --- a/BizHawk.Emulation.Common/Database/GameInfo.cs +++ b/BizHawk.Emulation.Common/Database/GameInfo.cs @@ -39,10 +39,10 @@ namespace BizHawk.Emulation.Common { Name = "Null", System = "NULL", - Hash = string.Empty, - Region = string.Empty, + Hash = "", + Region = "", Status = RomStatus.GoodDump, - ForcedCore = string.Empty, + ForcedCore = "", NotInDatabase = false }; @@ -62,7 +62,7 @@ namespace BizHawk.Emulation.Common public void AddOption(string option) { - Options[option] = string.Empty; + Options[option] = ""; } public void AddOption(string option, string param) @@ -174,7 +174,7 @@ namespace BizHawk.Emulation.Common { var parts = opt.Split('='); var key = parts[0]; - var value = parts.Length > 1 ? parts[1] : string.Empty; + var value = parts.Length > 1 ? parts[1] : ""; Options[key] = value; } } diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64Util.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64Util.cs index 5936395ba4..24b5405c35 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64Util.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64Util.cs @@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 { public static string ToBinary(int n, int charsmin) { - var result = new StringBuilder(string.Empty); + var result = new StringBuilder(""); while (n > 0 || charsmin > 0) { @@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 public static string ToHex(int n, int charsmin) { - var result = new StringBuilder(string.Empty); + var result = new StringBuilder(""); while (n > 0 || charsmin > 0) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs index 8aec5da41f..fd56a0b410 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IEmulator.cs @@ -20,11 +20,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy { if (s.Contains("P1 ")) { - LCont.Set(s.Replace("P1 ", string.Empty)); + LCont.Set(s.Replace("P1 ", "")); } else if (s.Contains("P2 ")) { - RCont.Set(s.Replace("P2 ", string.Empty)); + RCont.Set(s.Replace("P2 ", "")); } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs index 52ed59141a..89aa4d02c2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs @@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public byte[] ram; NESWatch[] sysbus_watch = new NESWatch[65536]; public byte[] CIRAM; //AKA nametables - string game_name = string.Empty; //friendly name exposed to user and used as filename base + string game_name = ""; //friendly name exposed to user and used as filename base CartInfo cart; //the current cart prototype. should be moved into the board, perhaps internal INESBoard Board; //the board hardware that is currently driving things EDetectionOrigin origin = EDetectionOrigin.None; diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs index e33ba7c34b..c381111106 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -275,7 +275,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES { // return @"D:\roms\snes\SuperRoadBlaster\SuperRoadBlaster-1.pcm"; // return ""; - int wantsTrackNumber = int.Parse(hint.Replace("track-", string.Empty).Replace(".pcm", string.Empty)); + int wantsTrackNumber = int.Parse(hint.Replace("track-", "").Replace(".pcm", "")); wantsTrackNumber++; string wantsTrackString = wantsTrackNumber.ToString(); foreach (var child in msu1.ChildNodes.Cast()) @@ -289,7 +289,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES } // not found.. what to do? (every rom will get here when msu1.rom is requested) - return string.Empty; + return ""; } // not MSU-1. ok. @@ -308,14 +308,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES case "st018.rom": firmwareId = "ST018"; break; default: CoreComm.ShowMessage($"Unrecognized SNES firmware request \"{hint}\"."); - return string.Empty; + return ""; } // build romfilename string test = CoreComm.CoreFileProvider.GetFirmwarePath("SNES", firmwareId, false, "Game may function incorrectly without the requested firmware."); // we need to return something to bsnes - test = test ?? string.Empty; + test = test ?? ""; Console.WriteLine("Served libsnes request for firmware \"{0}\" with \"{1}\"", hint, test); diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs index 3a2015a039..549f5e4517 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs @@ -211,7 +211,7 @@ namespace BizHawk.Emulation.Cores.PCEngine Cpu.Logger = (s) => Tracer.Put(new TraceInfo { Disassembly = $"{SF2MapperLatch:X1}:{s}", - RegisterInfo = string.Empty + RegisterInfo = "" }); } else diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.ITraceable.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.ITraceable.cs index 2ae4639f68..fbe28f473e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.ITraceable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.ITraceable.cs @@ -39,7 +39,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx { sb.Append( string.Format("{0}:{1} ", - r.Key.Replace("M68K", string.Empty).Trim(), + r.Key.Replace("M68K", "").Trim(), r.Value.Value.ToHexString(r.Value.BitSize / 4))); } } diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.ITraceable.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.ITraceable.cs index c9d8abf61e..3a8a55fac5 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.ITraceable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.ITraceable.cs @@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx64 { sb.Append( string.Format("{0}:{1} ", - r.Key.Replace("M68K", string.Empty).Trim(), + r.Key.Replace("M68K", "").Trim(), r.Value.Value.ToHexString(r.Value.BitSize / 4))); } } diff --git a/Bizware/BizHawk.Bizware.BizwareGL/Borrowed/BitmapFontParser/BitmapFontLoader.cs b/Bizware/BizHawk.Bizware.BizwareGL/Borrowed/BitmapFontParser/BitmapFontLoader.cs index a8e8dc291a..f25a9d1a47 100644 --- a/Bizware/BizHawk.Bizware.BizwareGL/Borrowed/BitmapFontParser/BitmapFontLoader.cs +++ b/Bizware/BizHawk.Bizware.BizwareGL/Borrowed/BitmapFontParser/BitmapFontLoader.cs @@ -314,7 +314,7 @@ namespace Cyotek.Drawing.BitmapFont { string result; - result = string.Empty; + result = ""; name = name.ToLowerInvariant(); foreach (string part in parts)