diff --git a/BurnOutSharp/Progress.cs b/BurnOutSharp/FileProtection.cs similarity index 74% rename from BurnOutSharp/Progress.cs rename to BurnOutSharp/FileProtection.cs index 34c408ad..63311b89 100644 --- a/BurnOutSharp/Progress.cs +++ b/BurnOutSharp/FileProtection.cs @@ -1,12 +1,12 @@ namespace BurnOutSharp { - public class Progress + public class FileProtection { public string Filename { get; private set; } public float Percentage { get; private set; } public string Protection { get; private set; } - public Progress(string filename, float percentage, string protection) + public FileProtection(string filename, float percentage, string protection) { this.Filename = filename; this.Percentage = percentage; diff --git a/Test/Program.cs b/Test/Program.cs index 5ada2951..1c2fade1 100644 --- a/Test/Program.cs +++ b/Test/Program.cs @@ -8,12 +8,19 @@ namespace Test { static void Main(string[] args) { + var p = new Progress(); + p.ProgressChanged += Changed; foreach (string arg in args) { - Console.WriteLine(String.Join("\r\n", ProtectionFind.Scan(arg).Select(kvp => kvp.Key + ": " + kvp.Value))); + Console.WriteLine(String.Join("\r\n", ProtectionFind.Scan(arg, p).Select(kvp => kvp.Key + ": " + kvp.Value))); } Console.ReadLine(); } + + private static void Changed(object source, FileProtection value) + { + Console.WriteLine($"{value.Percentage * 100}: {value.Filename} - {value.Protection}"); + } } }