mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-09-22 06:45:03 +00:00
Progress => FileProtection
This also implements a sample usage in the Test program
This commit is contained in:
@@ -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;
|
||||
@@ -8,12 +8,19 @@ namespace Test
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var p = new Progress<FileProtection>();
|
||||
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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user