-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppServices.cs
More file actions
39 lines (34 loc) · 1.53 KB
/
Copy pathAppServices.cs
File metadata and controls
39 lines (34 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using SDRIQStreamer.CWSkimmer;
using SDRIQStreamer.Digital;
using SDRIQStreamer.FlexRadio;
namespace SDRIQStreamer.App;
/// <summary>
/// Lightweight composition root for application services.
/// Keeps startup wiring in one place without adding a DI framework.
/// </summary>
public sealed class AppServices
{
public AppSettingsStore SettingsStore { get; }
public AppSettingsSession SettingsSession { get; }
public IRadioDiscovery Discovery { get; }
public IRadioConnection Connection { get; }
public IAudioDeviceFinder DeviceFinder { get; }
public ICwSkimmerLauncher Launcher { get; }
public IDigitalAppLauncher DigitalLauncher { get; }
public IReleaseUpdateService ReleaseUpdateService { get; }
public AppServices()
{
SettingsStore = new AppSettingsStore();
SettingsSession = new AppSettingsSession(SettingsStore);
Discovery = new FlexLibRadioDiscovery();
Connection = new FlexLibRadioConnection();
DeviceFinder = new WdmAudioDeviceFinder();
ReleaseUpdateService = new ReleaseUpdateService();
var modelFactory = new CwSkimmerIniModelFactory(DeviceFinder);
var iniWriter = new CwSkimmerIniWriter();
Launcher = new CwSkimmerLauncher(modelFactory, iniWriter, DeviceFinder, () => new CwSkimmerTelnetClient());
DigitalLauncher = new DigitalAppLauncher();
}
public MainWindowViewModel CreateMainWindowViewModel()
=> new(Discovery, Connection, Launcher, DigitalLauncher, SettingsSession, ReleaseUpdateService, DeviceFinder);
}