Move Options to root of Core

This commit is contained in:
Matt Nadareski
2024-05-23 13:47:14 -04:00
parent dbf7150a31
commit daa3261c16
12 changed files with 21 additions and 19 deletions

View File

@@ -82,6 +82,7 @@
- Rename Protection to ProtectionTool
- Move ProtectionTool to Core.Utilities
- Move Drive to root of Core
- Move Options to root of Core
### 3.1.9a (2024-05-21)

View File

@@ -47,7 +47,7 @@ namespace MPF.Core
/// <summary>
/// Options object representing user-defined options
/// </summary>
private readonly Data.Options _options;
private readonly Core.Options _options;
/// <summary>
/// Processor object representing how to process the outputs
@@ -130,7 +130,7 @@ namespace MPF.Core
/// <param name="type"></param>
/// <param name="internalProgram"></param>
/// <param name="parameters"></param>
public DumpEnvironment(Data.Options options,
public DumpEnvironment(Core.Options options,
string outputPath,
Drive? drive,
RedumpSystem? system,

View File

@@ -1,8 +1,9 @@
using System.Collections.Generic;
using MPF.Core.Data;
using MPF.Core.Utilities;
using SabreTools.RedumpLib.Data;
namespace MPF.Core.Data
namespace MPF.Core
{
public class Options
{

View File

@@ -22,11 +22,11 @@ namespace MPF.Core.UI.ViewModels
/// <summary>
/// Access to the current options
/// </summary>
public Data.Options Options
public Core.Options Options
{
get => _options;
}
private readonly Data.Options _options;
private readonly Core.Options _options;
/// <summary>
/// Indicates if SelectionChanged events can be executed

View File

@@ -15,11 +15,11 @@ namespace MPF.Core.UI.ViewModels
/// <summary>
/// Access to the current options
/// </summary>
public Data.Options Options
public Core.Options Options
{
get => _options;
}
private readonly Data.Options _options;
private readonly Core.Options _options;
/// <summary>
/// Indicates if SelectionChanged events can be executed

View File

@@ -19,7 +19,7 @@ namespace MPF.Core.UI.ViewModels
/// <summary>
/// Access to the current options
/// </summary>
public Data.Options Options
public Core.Options Options
{
get => _options;
set
@@ -28,7 +28,7 @@ namespace MPF.Core.UI.ViewModels
OptionsLoader.SaveToConfig(_options);
}
}
private Data.Options _options;
private Core.Options _options;
/// <summary>
/// Indicates if SelectionChanged events can be executed
@@ -962,13 +962,13 @@ namespace MPF.Core.UI.ViewModels
/// </summary>
/// <param name="savedSettings">Indicates if the settings were saved or not</param>
/// <param name="newOptions">Options representing the new, saved values</param>
public void UpdateOptions(bool savedSettings, Data.Options? newOptions)
public void UpdateOptions(bool savedSettings, Core.Options? newOptions)
{
// Get which options to save
var optionsToSave = savedSettings ? newOptions : Options;
// Ensure the first run flag is unset
var continuingOptions = new Data.Options(optionsToSave) { FirstRun = false };
var continuingOptions = new Core.Options(optionsToSave) { FirstRun = false };
this.Options = continuingOptions;
// If settings were changed, reinitialize the UI

View File

@@ -85,7 +85,7 @@ namespace MPF.Core.Utilities
/// <param name="progress">Optional progress callback</param>
/// <returns>Detected copy protection(s) if possible, null on error</returns>
internal static async Task<(string?, Dictionary<string, List<string>>?)> GetCopyProtection(Drive? drive,
Data.Options options,
Core.Options options,
IProgress<ProtectionProgress>? progress = null)
{
if (options.ScanForProtection && drive?.Name != null)

View File

@@ -21,7 +21,7 @@ namespace MPF.Core.Utilities
/// <param name="progress">Optional progress callback</param>
/// <returns>Set of all detected copy protections with an optional error string</returns>
public static async Task<(Dictionary<string, List<string>>?, string?)> RunProtectionScanOnPath(string path,
Data.Options options,
Core.Options options,
IProgress<ProtectionProgress>? progress = null)
{
try

View File

@@ -44,7 +44,7 @@ namespace MPF.Core.Utilities
Drive? drive,
RedumpSystem? system,
MediaType? mediaType,
Data.Options options,
Core.Options options,
BaseProcessor processor,
IProgress<ResultEventArgs>? resultProgress = null,
IProgress<ProtectionProgress>? protectionProgress = null)
@@ -149,9 +149,9 @@ namespace MPF.Core.Utilities
/// <param name="info">Existing SubmissionInfo object to fill</param>
/// <param name="resultProgress">Optional result progress callback</param>
#if NET40
public static bool FillFromRedump(Data.Options options, SubmissionInfo info, IProgress<ResultEventArgs>? resultProgress = null)
public static bool FillFromRedump(Core.Options options, SubmissionInfo info, IProgress<ResultEventArgs>? resultProgress = null)
#else
public async static Task<bool> FillFromRedump(Data.Options options, SubmissionInfo info, IProgress<ResultEventArgs>? resultProgress = null)
public async static Task<bool> FillFromRedump(Core.Options options, SubmissionInfo info, IProgress<ResultEventArgs>? resultProgress = null)
#endif
{
// If no username is provided

View File

@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using MPF.Core.Data;
using MPF.Core;
using MPF.Core.ExecutionContexts.DiscImageCreator;
using SabreTools.RedumpLib.Data;
using Xunit;

View File

@@ -1,7 +1,7 @@
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using MPF.Core.Data;
using MPF.Core;
using MPF.Core.UI.ViewModels;
using MPF.Core.Utilities;
using MPF.UI.Core.UserControls;

View File

@@ -4,7 +4,7 @@ using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using MPF.Core.Data;
using MPF.Core;
using MPF.Core.UI.ViewModels;
using WPFCustomMessageBox;