Move some classes to new library

This commit is contained in:
Matt Nadareski
2023-09-18 00:33:24 -04:00
parent 995521b789
commit 71fd5af48e
6 changed files with 27 additions and 4 deletions

View File

@@ -1,14 +1,18 @@
using BinaryObjectScanner.Interfaces;
using BinaryObjectScanner.Utilities;
namespace BurnOutSharp
namespace BinaryObjectScanner
{
internal static class Factory
public static class Factory
{
/// <summary>
/// Create an instance of a detectable based on file type
/// </summary>
#if NET48
public static IDetectable CreateDetectable(SupportedFileType fileType)
#else
public static IDetectable? CreateDetectable(SupportedFileType fileType)
#endif
{
switch (fileType)
{
@@ -29,7 +33,11 @@ namespace BurnOutSharp
/// <summary>
/// Create an instance of an extractable based on file type
/// </summary>
#if NET48
public static IExtractable CreateExtractable(SupportedFileType fileType)
#else
public static IExtractable? CreateExtractable(SupportedFileType fileType)
#endif
{
switch (fileType)
{

View File

@@ -1,4 +1,4 @@
namespace BurnOutSharp
namespace BinaryObjectScanner
{
/// <summary>
/// Scanning options

View File

@@ -1,4 +1,4 @@
namespace BurnOutSharp
namespace BinaryObjectScanner
{
/// <summary>
/// Struct representing protection scanning progress
@@ -8,17 +8,29 @@
/// <summary>
/// Filename to report progress for
/// </summary>
#if NET48
public string Filename { get; private set; }
#else
public string Filename { get; init; }
#endif
/// <summary>
/// Value between 0 and 1 representign the percentage completed
/// </summary>
#if NET48
public float Percentage { get; private set; }
#else
public float Percentage { get; init; }
#endif
/// <summary>
/// Protection information to report
/// </summary>
#if NET48
public string Protection { get; private set; }
#else
public string Protection { get; init; }
#endif
public ProtectionProgress(string filename, float percentage, string protection)
{

View File

@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BinaryObjectScanner;
using BinaryObjectScanner.FileType;
using BinaryObjectScanner.Interfaces;
using BinaryObjectScanner.Utilities;

View File

@@ -1,5 +1,6 @@
using System;
using System.Text;
using BinaryObjectScanner;
using BurnOutSharp;
namespace Test

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using BinaryObjectScanner;
using BurnOutSharp;
namespace Test