Skip to content

Commit

Permalink
initializing static field
Browse files Browse the repository at this point in the history
  • Loading branch information
A-tG committed Apr 24, 2022
1 parent b6c8347 commit 9be8242
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions VoicemeeterOsdProgram/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ async void OnAppStartup(object sender, StartupEventArgs e)
await ArgsHandler.HandleAsync(AppLifeManager.appArgs);
// start to recieve command-line arguments from other launched instance
AppLifeManager.StartArgsPipeServer();

Globals.Init(); // to initialize static fields
}
}
}
9 changes: 8 additions & 1 deletion VoicemeeterOsdProgram/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ namespace VoicemeeterOsdProgram;

public static class Globals
{
public static readonly AutostartManager autostartManager = UtilsFactory.GetAutostartManager();
public static readonly AutostartManager autostartManager;

public static class Osd
{
public static readonly FullscreenAppsWatcher fullscreenAppsWatcher = UtilsFactory.GetFullscreenAppsWatcher();
public static readonly ScreenProvider screenProvider = UtilsFactory.GetOsdScreenProvider();
public static readonly ScrWorkingAreaProvider workingAreaProvider = new(screenProvider);
}

static Globals()
{
autostartManager = UtilsFactory.GetAutostartManager();
}

static public void Init() { }
}

0 comments on commit 9be8242

Please sign in to comment.