From aac3c391db30c5ea37e857a5cd829b24f950bf6e Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 1 May 2022 14:11:09 -0700 Subject: [PATCH] Simplify construction and access in Scanner --- BurnOutSharp/Scanner.cs | 32 +++++++++++++++++++------------- Test/Program.cs | 7 +------ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/BurnOutSharp/Scanner.cs b/BurnOutSharp/Scanner.cs index 83fe74f4..ea05c88a 100644 --- a/BurnOutSharp/Scanner.cs +++ b/BurnOutSharp/Scanner.cs @@ -12,25 +12,25 @@ namespace BurnOutSharp { public class Scanner { - /// - /// Optional progress callback during scanning - /// - public IProgress FileProgress { get; set; } - - /// - /// Determines if debug information is output or not - /// - public bool IncludeDebug { get; set; } - /// /// Determines whether archives are decompressed and scanned /// - public bool ScanArchives { get; set; } + public bool ScanArchives { get; private set; } /// /// Determines if packers are counted as detected protections or not /// - public bool ScanPackers { get; set; } + public bool ScanPackers { get; private set; } + + /// + /// Determines if debug information is output or not + /// + public bool IncludeDebug { get; private set; } + + /// + /// Optional progress callback during scanning + /// + public IProgress FileProgress { get; private set; } /// /// Cache for all IPathCheck types @@ -40,9 +40,15 @@ namespace BurnOutSharp /// /// Constructor /// + /// Enable scanning archive contents + /// Enable including packers in output + /// Enable including debug information /// Optional progress callback - public Scanner(IProgress fileProgress = null) + public Scanner(bool scanArchives, bool scanPackers, bool includeDebug, IProgress fileProgress = null) { + ScanArchives = scanArchives; + ScanPackers = scanPackers; + IncludeDebug = includeDebug; FileProgress = fileProgress; } diff --git a/Test/Program.cs b/Test/Program.cs index 72b22846..83beeb8d 100644 --- a/Test/Program.cs +++ b/Test/Program.cs @@ -63,12 +63,7 @@ namespace Test } // Create scanner for all paths - var scanner = new Scanner(p) - { - IncludeDebug = debug, - ScanArchives = archives, - ScanPackers = packers, - }; + var scanner = new Scanner(archives, packers, debug, p); // Loop through the input paths foreach (string inputPath in inputPaths)