Skip to content

Commit

Permalink
MultipleInstancesDemo - RemoteConfigurationOptions for first instance
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-peichev committed Jun 26, 2024
1 parent 4e291b3 commit 539c3d1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions multi-instances/MultipleInstancesDemo/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,18 @@ protected override void OnStartup(StartupEventArgs e)

mutex_ = new Mutex(true, MutexName, out bool isOwned);

var rco = GDStartingContextProvider.ExtractRemoteConfigurationOptionsFromCmdLine() ??
GDStartingContextProvider.ExtractRemoteConfigurationOptionsFromEnvironment();

if (isOwned)
{
// First instance
StartPipeServer();
ProcessArguments(e.Args, null);
ProcessArguments(e.Args, rco);
}
else
{
// Second instance

var rco = GDStartingContextProvider.ExtractRemoteConfigurationOptionsFromCmdLine() ??
GDStartingContextProvider.ExtractRemoteConfigurationOptionsFromEnvironment();

SendArgumentsToFirstInstance(e.Args, rco);
// Terminate the second instance
Shutdown();
Expand Down

0 comments on commit 539c3d1

Please sign in to comment.