diff --git a/RombaSharp/Program.cs b/RombaSharp/Program.cs index 54166174..bd1c1ecd 100644 --- a/RombaSharp/Program.cs +++ b/RombaSharp/Program.cs @@ -28,7 +28,7 @@ namespace RombaSharp /// /// Logging object /// - private static Logger logger = new Logger(); + private static readonly Logger logger = new Logger(); #endregion diff --git a/SabreTools.Library/DatFiles/ClrMamePro.cs b/SabreTools.Library/DatFiles/ClrMamePro.cs index 551db677..31246900 100644 --- a/SabreTools.Library/DatFiles/ClrMamePro.cs +++ b/SabreTools.Library/DatFiles/ClrMamePro.cs @@ -136,48 +136,48 @@ namespace SabreTools.Library.DatFiles switch (itemKey) { case "name": - Header.Name = (Header.Name == null ? itemVal : Header.Name); + Header.Name = Header.Name ?? itemVal; superdat = superdat || itemVal.Contains(" - SuperDAT"); if (keep && superdat) - Header.Type = (Header.Type == null ? "SuperDAT" : Header.Type); + Header.Type = Header.Type ?? "SuperDAT"; break; case "description": - Header.Description = (Header.Description == null ? itemVal : Header.Description); + Header.Description = Header.Description ?? itemVal; break; case "rootdir": - Header.RootDir = (Header.RootDir == null ? itemVal : Header.RootDir); + Header.RootDir = Header.RootDir ?? itemVal; break; case "category": - Header.Category = (Header.Category == null ? itemVal : Header.Category); + Header.Category = Header.Category ?? itemVal; break; case "version": - Header.Version = (Header.Version == null ? itemVal : Header.Version); + Header.Version = Header.Version ?? itemVal; break; case "date": - Header.Date = (Header.Date == null ? itemVal : Header.Date); + Header.Date = Header.Date ?? itemVal; break; case "author": - Header.Author = (Header.Author == null ? itemVal : Header.Author); + Header.Author = Header.Author ?? itemVal; break; case "email": - Header.Email = (Header.Email == null ? itemVal : Header.Email); + Header.Email = Header.Email ?? itemVal; break; case "homepage": - Header.Homepage = (Header.Homepage == null ? itemVal : Header.Homepage); + Header.Homepage = Header.Homepage ?? itemVal; break; case "url": - Header.Url = (Header.Url == null ? itemVal : Header.Url); + Header.Url = Header.Url ?? itemVal; break; case "comment": - Header.Comment = (Header.Comment == null ? itemVal : Header.Comment); + Header.Comment = Header.Comment ?? itemVal; break; case "header": - Header.HeaderSkipper = (Header.HeaderSkipper == null ? itemVal : Header.HeaderSkipper); + Header.HeaderSkipper = Header.HeaderSkipper ?? itemVal; break; case "type": - Header.Type = (Header.Type == null ? itemVal : Header.Type); + Header.Type = Header.Type ?? itemVal; superdat = superdat || itemVal.Contains("SuperDAT"); break; case "forcemerging": diff --git a/SabreTools.Library/DatFiles/DosCenter.cs b/SabreTools.Library/DatFiles/DosCenter.cs index d1036b56..234f5041 100644 --- a/SabreTools.Library/DatFiles/DosCenter.cs +++ b/SabreTools.Library/DatFiles/DosCenter.cs @@ -116,25 +116,25 @@ namespace SabreTools.Library.DatFiles switch (itemKey) { case "name": - Header.Name = (Header.Name == null ? itemVal : Header.Name); + Header.Name = Header.Name ?? itemVal; break; case "description": - Header.Description = (Header.Description == null ? itemVal : Header.Description); + Header.Description = Header.Description ?? itemVal; break; case "dersion": - Header.Version = (Header.Version == null ? itemVal : Header.Version); + Header.Version = Header.Version ?? itemVal; break; case "date": - Header.Date = (Header.Date == null ? itemVal : Header.Date); + Header.Date = Header.Date ?? itemVal; break; case "author": - Header.Author = (Header.Author == null ? itemVal : Header.Author); + Header.Author = Header.Author ?? itemVal; break; case "homepage": - Header.Homepage = (Header.Homepage == null ? itemVal : Header.Homepage); + Header.Homepage = Header.Homepage ?? itemVal; break; case "comment": - Header.Comment = (Header.Comment == null ? itemVal : Header.Comment); + Header.Comment = Header.Comment ?? itemVal; break; } } diff --git a/SabreTools.Library/DatFiles/ItemDictionary.cs b/SabreTools.Library/DatFiles/ItemDictionary.cs index 76bd0274..7e9cca30 100644 --- a/SabreTools.Library/DatFiles/ItemDictionary.cs +++ b/SabreTools.Library/DatFiles/ItemDictionary.cs @@ -44,12 +44,12 @@ namespace SabreTools.Library.DatFiles /// /// Lock for statistics calculation /// - private object statsLock = new object(); + private readonly object statsLock = new object(); /// /// Logging object /// - private static Logger logger = new Logger(); + private readonly static Logger logger = new Logger(); #endregion diff --git a/SabreTools.Library/DatFiles/Listxml.cs b/SabreTools.Library/DatFiles/Listxml.cs index 3d5fba91..baa6e3b8 100644 --- a/SabreTools.Library/DatFiles/Listxml.cs +++ b/SabreTools.Library/DatFiles/Listxml.cs @@ -57,18 +57,18 @@ namespace SabreTools.Library.DatFiles switch (xtr.Name) { case "mame": - Header.Name = (Header.Name == null ? xtr.GetAttribute("build") : Header.Name); - Header.Description = (Header.Description == null ? Header.Name : Header.Description); - Header.Debug = (Header.Debug == null ? xtr.GetAttribute("debug").AsYesNo() : Header.Debug); - Header.MameConfig = (Header.MameConfig == null ? xtr.GetAttribute("mameconfig") : Header.MameConfig); + Header.Name = Header.Name ?? xtr.GetAttribute("build"); + Header.Description = Header.Description ?? Header.Name; + Header.Debug = Header.Debug ?? xtr.GetAttribute("debug").AsYesNo(); + Header.MameConfig = Header.MameConfig ?? xtr.GetAttribute("mameconfig"); xtr.Read(); break; // Handle M1 DATs since they're 99% the same as a SL DAT case "m1": - Header.Name = (Header.Name == null ? "M1" : Header.Name); - Header.Description = (Header.Description == null ? "M1" : Header.Description); - Header.Version = (Header.Version == null ? xtr.GetAttribute("version") ?? string.Empty : Header.Version); + Header.Name = Header.Name ?? "M1"; + Header.Description = Header.Description ?? "M1"; + Header.Version = Header.Version ?? xtr.GetAttribute("version") ?? string.Empty; xtr.Read(); break; @@ -653,10 +653,12 @@ namespace SabreTools.Library.DatFiles switch (reader.Name) { case "slotoption": - var slotOption = new SlotOption(); - slotOption.Name = reader.GetAttribute("name"); - slotOption.DeviceName = reader.GetAttribute("devname"); - slotOption.Default = reader.GetAttribute("default").AsYesNo(); + var slotOption = new SlotOption + { + Name = reader.GetAttribute("name"), + DeviceName = reader.GetAttribute("devname"), + Default = reader.GetAttribute("default").AsYesNo() + }; slot.SlotOptions.Add(slotOption); @@ -760,11 +762,13 @@ namespace SabreTools.Library.DatFiles switch (reader.Name) { case "condition": - var condition = new Condition(); - condition.Tag = reader.GetAttribute("tag"); - condition.Mask = reader.GetAttribute("mask"); - condition.Relation = reader.GetAttribute("relation").AsRelation(); - condition.Value = reader.GetAttribute("value"); + var condition = new Condition + { + Tag = reader.GetAttribute("tag"), + Mask = reader.GetAttribute("mask"), + Relation = reader.GetAttribute("relation").AsRelation(), + Value = reader.GetAttribute("value") + }; dipSwitch.Conditions.Add(condition); @@ -772,10 +776,12 @@ namespace SabreTools.Library.DatFiles break; case "diplocation": - var dipLocation = new Location(); - dipLocation.Name = reader.GetAttribute("name"); - dipLocation.Number = Sanitizer.CleanLong(reader.GetAttribute("number")); - dipLocation.Inverted = reader.GetAttribute("inverted").AsYesNo(); + var dipLocation = new Location + { + Name = reader.GetAttribute("name"), + Number = Sanitizer.CleanLong(reader.GetAttribute("number")), + Inverted = reader.GetAttribute("inverted").AsYesNo() + }; dipSwitch.Locations.Add(dipLocation); @@ -783,10 +789,12 @@ namespace SabreTools.Library.DatFiles break; case "dipvalue": - var dipValue = new Setting(); - dipValue.Name = reader.GetAttribute("name"); - dipValue.Value = reader.GetAttribute("value"); - dipValue.Default = reader.GetAttribute("default").AsYesNo(); + var dipValue = new Setting + { + Name = reader.GetAttribute("name"), + Value = reader.GetAttribute("value"), + Default = reader.GetAttribute("default").AsYesNo() + }; // Now read the internal tags ReadDipValue(reader, dipValue); @@ -834,11 +842,13 @@ namespace SabreTools.Library.DatFiles switch (reader.Name) { case "condition": - var condition = new Condition(); - condition.Tag = reader.GetAttribute("tag"); - condition.Mask = reader.GetAttribute("mask"); - condition.Relation = reader.GetAttribute("relation").AsRelation(); - condition.Value = reader.GetAttribute("value"); + var condition = new Condition + { + Tag = reader.GetAttribute("tag"), + Mask = reader.GetAttribute("mask"), + Relation = reader.GetAttribute("relation").AsRelation(), + Value = reader.GetAttribute("value") + }; dipValue.Conditions.Add(condition); @@ -884,11 +894,13 @@ namespace SabreTools.Library.DatFiles switch (reader.Name) { case "condition": - var condition = new Condition(); - condition.Tag = reader.GetAttribute("tag"); - condition.Mask = reader.GetAttribute("mask"); - condition.Relation = reader.GetAttribute("relation").AsRelation(); - condition.Value = reader.GetAttribute("value"); + var condition = new Condition + { + Tag = reader.GetAttribute("tag"), + Mask = reader.GetAttribute("mask"), + Relation = reader.GetAttribute("relation").AsRelation(), + Value = reader.GetAttribute("value") + }; configuration.Conditions.Add(condition); @@ -896,10 +908,12 @@ namespace SabreTools.Library.DatFiles break; case "conflocation": - var confLocation = new Location(); - confLocation.Name = reader.GetAttribute("name"); - confLocation.Number = Sanitizer.CleanLong(reader.GetAttribute("number")); - confLocation.Inverted = reader.GetAttribute("inverted").AsYesNo(); + var confLocation = new Location + { + Name = reader.GetAttribute("name"), + Number = Sanitizer.CleanLong(reader.GetAttribute("number")), + Inverted = reader.GetAttribute("inverted").AsYesNo() + }; configuration.Locations.Add(confLocation); @@ -907,10 +921,12 @@ namespace SabreTools.Library.DatFiles break; case "confsetting": - var confSetting = new Setting(); - confSetting.Name = reader.GetAttribute("name"); - confSetting.Value = reader.GetAttribute("value"); - confSetting.Default = reader.GetAttribute("default").AsYesNo(); + var confSetting = new Setting + { + Name = reader.GetAttribute("name"), + Value = reader.GetAttribute("value"), + Default = reader.GetAttribute("default").AsYesNo() + }; // Now read the internal tags ReadConfSetting(reader, confSetting); @@ -958,11 +974,13 @@ namespace SabreTools.Library.DatFiles switch (reader.Name) { case "condition": - var condition = new Condition(); - condition.Tag = reader.GetAttribute("tag"); - condition.Mask = reader.GetAttribute("mask"); - condition.Relation = reader.GetAttribute("relation").AsRelation(); - condition.Value = reader.GetAttribute("value"); + var condition = new Condition + { + Tag = reader.GetAttribute("tag"), + Mask = reader.GetAttribute("mask"), + Relation = reader.GetAttribute("relation").AsRelation(), + Value = reader.GetAttribute("value") + }; confSetting.Conditions.Add(condition); @@ -1006,8 +1024,10 @@ namespace SabreTools.Library.DatFiles switch (reader.Name) { case "analog": - var analog = new Analog(); - analog.Mask = reader.GetAttribute("mask"); + var analog = new Analog + { + Mask = reader.GetAttribute("mask") + }; port.Analogs.Add(analog); @@ -1051,11 +1071,13 @@ namespace SabreTools.Library.DatFiles switch (reader.Name) { case "condition": - var condition = new Condition(); - condition.Tag = reader.GetAttribute("tag"); - condition.Mask = reader.GetAttribute("mask"); - condition.Relation = reader.GetAttribute("relation").AsRelation(); - condition.Value = reader.GetAttribute("value"); + var condition = new Condition + { + Tag = reader.GetAttribute("tag"), + Mask = reader.GetAttribute("mask"), + Relation = reader.GetAttribute("relation").AsRelation(), + Value = reader.GetAttribute("value") + }; adjuster.Conditions.Add(condition); diff --git a/SabreTools.Library/DatFiles/Logiqx.cs b/SabreTools.Library/DatFiles/Logiqx.cs index 7d62d97a..72af4ea6 100644 --- a/SabreTools.Library/DatFiles/Logiqx.cs +++ b/SabreTools.Library/DatFiles/Logiqx.cs @@ -150,68 +150,68 @@ namespace SabreTools.Library.DatFiles switch (reader.Name) { case "name": - content = reader.ReadElementContentAsString(); ; - Header.Name = (Header.Name == null ? content : Header.Name); + content = reader.ReadElementContentAsString(); + Header.Name = Header.Name ?? content; superdat = superdat || content.Contains(" - SuperDAT"); if (keep && superdat) { - Header.Type = (Header.Type == null ? "SuperDAT" : Header.Type); + Header.Type = Header.Type ?? "SuperDAT"; } break; case "description": content = reader.ReadElementContentAsString(); - Header.Description = (Header.Description == null ? content : Header.Description); + Header.Description = Header.Description ?? content; break; case "rootdir": // This is exclusive to TruRip XML content = reader.ReadElementContentAsString(); - Header.RootDir = (Header.RootDir == null ? content : Header.RootDir); + Header.RootDir = Header.RootDir ?? content; break; case "category": content = reader.ReadElementContentAsString(); - Header.Category = (Header.Category == null ? content : Header.Category); + Header.Category = Header.Category ?? content; break; case "version": content = reader.ReadElementContentAsString(); - Header.Version = (Header.Version == null ? content : Header.Version); + Header.Version = Header.Version ?? content; break; case "date": content = reader.ReadElementContentAsString(); - Header.Date = (Header.Date == null ? content.Replace(".", "/") : Header.Date); + Header.Date = Header.Date ?? content.Replace(".", "/"); break; case "author": content = reader.ReadElementContentAsString(); - Header.Author = (Header.Author == null ? content : Header.Author); + Header.Author = Header.Author ?? content; break; case "email": content = reader.ReadElementContentAsString(); - Header.Email = (Header.Email == null ? content : Header.Email); + Header.Email = Header.Email ?? content; break; case "homepage": content = reader.ReadElementContentAsString(); - Header.Homepage = (Header.Homepage == null ? content : Header.Homepage); + Header.Homepage = Header.Homepage ?? content; break; case "url": content = reader.ReadElementContentAsString(); - Header.Url = (Header.Url == null ? content : Header.Url); + Header.Url = Header.Url ?? content; break; case "comment": content = reader.ReadElementContentAsString(); - Header.Comment = (Header.Comment == null ? content : Header.Comment); + Header.Comment = (Header.Comment ?? content); break; case "type": // This is exclusive to TruRip XML content = reader.ReadElementContentAsString(); - Header.Type = (Header.Type == null ? content : Header.Type); + Header.Type = Header.Type ?? content; superdat = superdat || content.Contains("SuperDAT"); break; diff --git a/SabreTools.Library/DatFiles/OfflineList.cs b/SabreTools.Library/DatFiles/OfflineList.cs index 81c10f2e..b4229585 100644 --- a/SabreTools.Library/DatFiles/OfflineList.cs +++ b/SabreTools.Library/DatFiles/OfflineList.cs @@ -122,34 +122,34 @@ namespace SabreTools.Library.DatFiles { case "datname": content = reader.ReadElementContentAsString(); - Header.Name = (Header.Name == null ? content : Header.Name); + Header.Name = Header.Name ?? content; superdat = superdat || content.Contains(" - SuperDAT"); if (keep && superdat) { - Header.Type = (Header.Type == null ? "SuperDAT" : Header.Type); + Header.Type = Header.Type ?? "SuperDAT"; } break; case "datversion": content = reader.ReadElementContentAsString(); - Header.Version = (Header.Version == null ? content : Header.Version); + Header.Version = Header.Version ?? content; break; case "system": content = reader.ReadElementContentAsString(); - Header.System = (Header.System == null ? content : Header.System); + Header.System = Header.System ?? content; break; // TODO: Int32? case "screenshotswidth": content = reader.ReadElementContentAsString(); - Header.ScreenshotsWidth = (Header.ScreenshotsWidth == null ? content : Header.ScreenshotsWidth); + Header.ScreenshotsWidth = Header.ScreenshotsWidth ?? content; break; // TODO: Int32? case "screenshotsheight": content = reader.ReadElementContentAsString(); - Header.ScreenshotsHeight = (Header.ScreenshotsHeight == null ? content : Header.ScreenshotsHeight); + Header.ScreenshotsHeight = Header.ScreenshotsHeight ?? content; break; case "infos": @@ -184,7 +184,7 @@ namespace SabreTools.Library.DatFiles case "romtitle": content = reader.ReadElementContentAsString(); - Header.RomTitle = (Header.RomTitle == null ? content : Header.RomTitle); + Header.RomTitle = Header.RomTitle ?? content; break; default: @@ -224,11 +224,13 @@ namespace SabreTools.Library.DatFiles switch (reader.Name.ToLowerInvariant()) { case "info": - var info = new OfflineListInfo(); - info.Name = reader.Name.ToLowerInvariant(); - info.Visible = reader.GetAttribute("visible").AsYesNo(); - info.InNamingOption = reader.GetAttribute("inNamingOption").AsYesNo(); - info.Default = reader.GetAttribute("default").AsYesNo(); + var info = new OfflineListInfo + { + Name = reader.Name.ToLowerInvariant(), + Visible = reader.GetAttribute("visible").AsYesNo(), + InNamingOption = reader.GetAttribute("inNamingOption").AsYesNo(), + Default = reader.GetAttribute("default").AsYesNo() + }; Header.Infos.Add(info); diff --git a/SabreTools.Library/DatFiles/OpenMSX.cs b/SabreTools.Library/DatFiles/OpenMSX.cs index 0537bd3e..e1de45e8 100644 --- a/SabreTools.Library/DatFiles/OpenMSX.cs +++ b/SabreTools.Library/DatFiles/OpenMSX.cs @@ -56,9 +56,9 @@ namespace SabreTools.Library.DatFiles switch (xtr.Name) { case "softwaredb": - Header.Name = (Header.Name == null ? "openMSX Software List" : Header.Name); - Header.Description = (Header.Description == null ? Header.Name : Header.Description); - Header.Date = (Header.Date == null ? xtr.GetAttribute("timestamp") : Header.Date); + Header.Name = Header.Name ?? "openMSX Software List"; + Header.Description = Header.Description ?? Header.Name; + Header.Date = Header.Date ?? xtr.GetAttribute("timestamp"); xtr.Read(); break; @@ -242,9 +242,11 @@ namespace SabreTools.Library.DatFiles break; case "original": - original = new Original(); - original.Value = reader.GetAttribute("value").AsYesNo(); - original.Content = reader.ReadElementContentAsString(); + original = new Original + { + Value = reader.GetAttribute("value").AsYesNo(), + Content = reader.ReadElementContentAsString() + }; break; default: diff --git a/SabreTools.Library/DatFiles/RomCenter.cs b/SabreTools.Library/DatFiles/RomCenter.cs index 26987d79..90ddbc58 100644 --- a/SabreTools.Library/DatFiles/RomCenter.cs +++ b/SabreTools.Library/DatFiles/RomCenter.cs @@ -203,12 +203,12 @@ namespace SabreTools.Library.DatFiles switch (kvp?.Key.ToLowerInvariant()) { case "version": - Header.RomCenterVersion = Header.RomCenterVersion ?? (kvp?.Value); + Header.RomCenterVersion = Header.RomCenterVersion ?? kvp?.Value; reader.ReadNextLine(); break; case "plugin": - Header.System = (Header.System == null ? kvp?.Value : Header.System); + Header.System = Header.System ?? kvp?.Value; reader.ReadNextLine(); break; @@ -267,12 +267,12 @@ namespace SabreTools.Library.DatFiles switch (kvp?.Key.ToLowerInvariant()) { case "refname": - Header.Name = Header.Name == null ? kvp?.Value : Header.Name; + Header.Name = Header.Name ?? kvp?.Value; reader.ReadNextLine(); break; case "version": - Header.Description = Header.Description == null ? kvp?.Value : Header.Description; + Header.Description = Header.Description ?? kvp?.Value; reader.ReadNextLine(); break; diff --git a/SabreTools.Library/DatFiles/SoftwareList.cs b/SabreTools.Library/DatFiles/SoftwareList.cs index 01127abb..697476dc 100644 --- a/SabreTools.Library/DatFiles/SoftwareList.cs +++ b/SabreTools.Library/DatFiles/SoftwareList.cs @@ -58,8 +58,8 @@ namespace SabreTools.Library.DatFiles switch (xtr.Name) { case "softwarelist": - Header.Name = (Header.Name == null ? xtr.GetAttribute("name") ?? string.Empty : Header.Name); - Header.Description = (Header.Description == null ? xtr.GetAttribute("description") ?? string.Empty : Header.Description); + Header.Name = Header.Name ?? xtr.GetAttribute("name") ?? string.Empty; + Header.Description = Header.Description ?? xtr.GetAttribute("description") ?? string.Empty; xtr.Read(); break; diff --git a/SabreTools.Library/Filtering/ExtraIni.cs b/SabreTools.Library/Filtering/ExtraIni.cs index 2a9096a7..999eb8fc 100644 --- a/SabreTools.Library/Filtering/ExtraIni.cs +++ b/SabreTools.Library/Filtering/ExtraIni.cs @@ -21,7 +21,7 @@ namespace SabreTools.Library.Filtering /// /// Logging object /// - private Logger logger = new Logger(); + private readonly Logger logger = new Logger(); #endregion diff --git a/SabreTools.Library/Filtering/Filter.cs b/SabreTools.Library/Filtering/Filter.cs index 6a92d003..f158d31f 100644 --- a/SabreTools.Library/Filtering/Filter.cs +++ b/SabreTools.Library/Filtering/Filter.cs @@ -291,7 +291,7 @@ namespace SabreTools.Library.Filtering /// /// Logging object /// - private Logger logger = new Logger(); + private readonly Logger logger = new Logger(); #endregion diff --git a/SabreTools.Library/Help/TopLevel.cs b/SabreTools.Library/Help/TopLevel.cs index 33eadaec..cb54f6ec 100644 --- a/SabreTools.Library/Help/TopLevel.cs +++ b/SabreTools.Library/Help/TopLevel.cs @@ -18,7 +18,7 @@ namespace SabreTools.Library.Help /// /// Logging object /// - private Logger logger = new Logger(); + private readonly Logger logger = new Logger(); #endregion diff --git a/SabreTools.Library/IO/FileExtensions.cs b/SabreTools.Library/IO/FileExtensions.cs index 2f76b508..a766a816 100644 --- a/SabreTools.Library/IO/FileExtensions.cs +++ b/SabreTools.Library/IO/FileExtensions.cs @@ -23,7 +23,7 @@ namespace SabreTools.Library.IO /// /// Logging object /// - private static Logger logger = new Logger(); + private static readonly Logger logger = new Logger(); #endregion diff --git a/SabreTools.Library/Logging/Logger.cs b/SabreTools.Library/Logging/Logger.cs index d2dc5102..3f2d4d4d 100644 --- a/SabreTools.Library/Logging/Logger.cs +++ b/SabreTools.Library/Logging/Logger.cs @@ -11,7 +11,7 @@ namespace SabreTools.Library.Logging /// Instance associated with this logger /// /// TODO: Derive class name for this object, if possible - private object instance; + private readonly object instance; /// /// Constructor diff --git a/SabreTools.Library/Skippers/SkipperRule.cs b/SabreTools.Library/Skippers/SkipperRule.cs index fc7e6a40..ffac73d6 100644 --- a/SabreTools.Library/Skippers/SkipperRule.cs +++ b/SabreTools.Library/Skippers/SkipperRule.cs @@ -43,7 +43,7 @@ namespace SabreTools.Library.Skippers /// /// Logging object /// - private Logger logger = new Logger(); + private readonly Logger logger = new Logger(); #endregion diff --git a/SabreTools.Library/Skippers/Transform.cs b/SabreTools.Library/Skippers/Transform.cs index bbf91fee..a46ea1bd 100644 --- a/SabreTools.Library/Skippers/Transform.cs +++ b/SabreTools.Library/Skippers/Transform.cs @@ -37,7 +37,7 @@ namespace SabreTools.Library.Skippers /// /// Logging object /// - private static Logger logger = new Logger(); + private static readonly Logger logger = new Logger(); #endregion diff --git a/SabreTools.Library/Tools/DatabaseTools.cs b/SabreTools.Library/Tools/DatabaseTools.cs index b1be9620..e3376c43 100644 --- a/SabreTools.Library/Tools/DatabaseTools.cs +++ b/SabreTools.Library/Tools/DatabaseTools.cs @@ -18,7 +18,7 @@ namespace SabreTools.Library.Tools /// /// Logging object /// - private static Logger logger = new Logger(); + private static readonly Logger logger = new Logger(); #endregion diff --git a/SabreTools.Library/Tools/InternalStopwatch.cs b/SabreTools.Library/Tools/InternalStopwatch.cs index c77d51da..c5e0e151 100644 --- a/SabreTools.Library/Tools/InternalStopwatch.cs +++ b/SabreTools.Library/Tools/InternalStopwatch.cs @@ -11,7 +11,7 @@ namespace SabreTools.Library.Tools { private string _subject; private DateTime _startTime; - private Logger _logger = new Logger(); + private readonly Logger _logger = new Logger(); /// /// Constructor that initalizes the stopwatch diff --git a/SabreTools/Program.cs b/SabreTools/Program.cs index 481566c8..1121c187 100644 --- a/SabreTools/Program.cs +++ b/SabreTools/Program.cs @@ -20,7 +20,7 @@ namespace SabreTools /// /// Logging object /// - private static Logger logger = new Logger(); + private static readonly Logger logger = new Logger(); #endregion