Move Initialize method and make setters private
MODIFY
WalletWasabi.Fluent.Desktop/Program.cs
WalletWasabi.Fluent.Desktop/Program.cs
@@ -72,7 +72,7 @@ namespace WalletWasabi.Fluent.Desktop
// TODO only required due to statusbar vm... to be removed.
Locator.CurrentMutable.RegisterConstant(Global);
- InitializeServices(Global);
+ Services.Initialize(Global);
Logger.LogSoftwareStarted("Wasabi GUI");
BuildAvaloniaApp()
@@ -113,26 +113,6 @@ namespace WalletWasabi.Fluent.Desktop
return exceptionToReport is { } ? 1 : 0;
}
- /// <summary>
- /// Initializes global services used by fluent project.
- /// </summary>
- /// <param name="global">The global instance.</param>
- private static void InitializeServices(Global global)
- {
- Services.DataDir = global.DataDir;
- Services.TorSettings = global.TorSettings;
- Services.BitcoinStore = global.BitcoinStore;
- Services.ExternalHttpClientFactory = global.ExternalHttpClientFactory;
- Services.LegalChecker = global.LegalChecker;
- Services.Config = global.Config;
- Services.Synchronizer = global.Synchronizer;
- Services.WalletManager = global.WalletManager;
- Services.TransactionBroadcaster = global.TransactionBroadcaster;
- Services.HostedServices = global.HostedServices;
- Services.UiConfig = global.UiConfig;
- Services.IsInitialized = true;
- }
-
/// <summary>
/// Initializes Wasabi Logger. Sets user-defined log-level, if provided.
/// </summary>

MODIFY
WalletWasabi.Fluent/Services.cs
WalletWasabi.Fluent/Services.cs
@@ -10,17 +10,37 @@ namespace WalletWasabi.Fluent
{
public static class Services
{
- public static string DataDir { get; set; }
- public static TorSettings TorSettings { get; set; }
+ public static string DataDir { get; private set; }
+ public static TorSettings TorSettings { get; private set; }
public static BitcoinStore BitcoinStore { get; set; }
- public static HttpClientFactory ExternalHttpClientFactory { get; set; }
- public static LegalChecker LegalChecker { get; set; }
- public static Config Config { get; set; }
- public static WasabiSynchronizer Synchronizer { get; set; }
- public static WalletManager WalletManager { get; set; }
- public static TransactionBroadcaster TransactionBroadcaster { get; set; }
- public static HostedServices HostedServices { get; set; }
- public static UiConfig UiConfig { get; set; }
- public static bool IsInitialized { get; set; }
+ public static HttpClientFactory ExternalHttpClientFactory { get; private set; }
+ public static LegalChecker LegalChecker { get; private set; }
+ public static Config Config { get; private set; }
+ public static WasabiSynchronizer Synchronizer { get; private set; }
+ public static WalletManager WalletManager { get; private set; }
+ public static TransactionBroadcaster TransactionBroadcaster { get; private set; }
+ public static HostedServices HostedServices { get; private set; }
+ public static UiConfig UiConfig { get; private set; }
+ public static bool IsInitialized { get; private set; }
+
+ /// <summary>
+ /// Initializes global services used by fluent project.
+ /// </summary>
+ /// <param name="global">The global instance.</param>
+ public static void Initialize(Global global)
+ {
+ DataDir = global.DataDir;
+ TorSettings = global.TorSettings;
+ BitcoinStore = global.BitcoinStore;
+ ExternalHttpClientFactory = global.ExternalHttpClientFactory;
+ LegalChecker = global.LegalChecker;
+ Config = global.Config;
+ Synchronizer = global.Synchronizer;
+ WalletManager = global.WalletManager;
+ TransactionBroadcaster = global.TransactionBroadcaster;
+ HostedServices = global.HostedServices;
+ UiConfig = global.UiConfig;
+ IsInitialized = true;
+ }
}
}
\ No newline at end of file

Move Initialize method and make setters private