From c3a3caf4e293dc1430a238cb621fe6118cc50f1a Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 23 Dec 2017 02:41:37 +0000 Subject: [PATCH] DOCUMENTATION: Added XML documentation to DiscImageChef.Settings. --- DiscImageChef.Settings/Settings.cs | 79 ++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/DiscImageChef.Settings/Settings.cs b/DiscImageChef.Settings/Settings.cs index 41fbb58a..45eef100 100644 --- a/DiscImageChef.Settings/Settings.cs +++ b/DiscImageChef.Settings/Settings.cs @@ -40,42 +40,109 @@ using PlatformID = DiscImageChef.Interop.PlatformID; namespace DiscImageChef.Settings { + /// + /// Settings + /// public class DicSettings { + /// + /// Statistics + /// public StatsSettings Stats; + /// + /// If set to true, reports will be saved locally + /// public bool SaveReportsGlobally; + /// + /// If set to true, reports will be sent to DiscImageChef.Server + /// public bool ShareReports; } + // TODO: Use this + /// + /// User settings, for media dumps, completely unused + /// public class UserSettings { public string Name; public string Email; } + /// + /// Statistics settings + /// public class StatsSettings { + /// + /// If set to true, statistics will be sent to DiscImageChef.Server + /// public bool ShareStats; + /// + /// If set to true, benchmark statistics will be stored + /// public bool BenchmarkStats; + /// + /// If set to true, command usage statistics will be stored + /// public bool CommandStats; + /// + /// If set to true, device statistics will be stored + /// public bool DeviceStats; + /// + /// If set to true, filesystem statistics will be stored + /// public bool FilesystemStats; + /// + /// If set to true, filters statistics will be stored + /// public bool FilterStats; + /// + /// If set to true, dump media images statistics will be stored + /// public bool MediaImageStats; + /// + /// If set to true, media scan statistics will be stored + /// public bool MediaScanStats; + /// + /// If set to true, partition schemes statistics will be stored + /// public bool PartitionStats; + /// + /// If set to true, media types statistics will be stored + /// public bool MediaStats; + /// + /// If set to true, dump media verification statistics will be stored + /// public bool VerifyStats; } + /// + /// Manages statistics + /// public static class Settings { + /// + /// Current statistcs + /// public static DicSettings Current; + /// + /// Global path to save reports + /// static string ReportsPath { get; set; } + /// + /// Global path to save statistics + /// public static string StatsPath { get; private set; } + /// + /// Loads settings + /// public static void LoadSettings() { Current = new DicSettings(); @@ -85,6 +152,7 @@ namespace DiscImageChef.Settings { switch(ptId) { + // In case of macOS or iOS statistics and reports will be saved in ~/Library/Application Support/Claunia.com/DiscImageChef case PlatformID.MacOSX: case PlatformID.iOS: { @@ -103,6 +171,7 @@ namespace DiscImageChef.Settings if(!Directory.Exists(StatsPath)) Directory.CreateDirectory(StatsPath); } break; + // In case of Windows statistics and reports will be saved in %APPDATA%\Claunia.com\DiscImageChef case PlatformID.Win32NT: case PlatformID.Win32S: case PlatformID.Win32Windows: @@ -124,6 +193,7 @@ namespace DiscImageChef.Settings if(!Directory.Exists(StatsPath)) Directory.CreateDirectory(StatsPath); } break; + // Otherwise, statistics and reports will be saved in ~/.claunia.com/DiscImageChef default: { string appSupportPath = @@ -152,6 +222,7 @@ namespace DiscImageChef.Settings { switch(ptId) { + // In case of macOS or iOS settings will be saved in ~/Library/Preferences/com.claunia.discimagechef.plist case PlatformID.MacOSX: case PlatformID.iOS: { @@ -222,6 +293,7 @@ namespace DiscImageChef.Settings } } break; + // In case of Windows settings will be saved in the registry: HKLM/SOFTWARE/Claunia.com/DiscImageChef case PlatformID.Win32NT: case PlatformID.Win32S: case PlatformID.Win32Windows: @@ -268,6 +340,7 @@ namespace DiscImageChef.Settings } break; + // Otherwise, settings will be saved in ~/.config/DiscImageChef.xml default: { string configPath = @@ -306,6 +379,7 @@ namespace DiscImageChef.Settings switch(ptId) { + // In case of macOS or iOS settings will be saved in ~/Library/Preferences/com.claunia.discimagechef.plist case PlatformID.MacOSX: case PlatformID.iOS: { @@ -343,6 +417,7 @@ namespace DiscImageChef.Settings fs.Close(); } break; + // In case of Windows settings will be saved in the registry: HKLM/SOFTWARE/Claunia.com/DiscImageChef case PlatformID.Win32NT: case PlatformID.Win32S: case PlatformID.Win32Windows: @@ -390,6 +465,7 @@ namespace DiscImageChef.Settings } } break; + // Otherwise, settings will be saved in ~/.config/DiscImageChef.xml default: { string configPath = @@ -412,6 +488,9 @@ namespace DiscImageChef.Settings #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body } + /// + /// Sets default settings as all statistics, share everything + /// static void SetDefaultSettings() { Current = new DicSettings