/// <inheritdoc /> public void RegisterApplicationInstance(ApplicationInstanceDescription instance) { if (instance == null) { throw new ArgumentNullException(nameof(instance)); } _internalWatchdog.RegisterApplicationInstance(instance); }
private Process StartNewProcress(string instanceName) { lock (_syncRoot) { ApplicationInstanceDescription instance = _registeredApplicationInstances[instanceName]; InstalledFile executable = instance.Executable; InstalledApplication application = _installedApplications[instance.ApplicationName]; var process = new Process { StartInfo = new ProcessStartInfo { FileName = Resolve(application, executable.Folder, executable.Filename), }, EnableRaisingEvents = true }; return(process); } }
public void RegisterApplicationInstance(ApplicationInstanceDescription instance) { lock (_syncRoot) { if (_registeredApplicationInstances.ContainsKey(instance.Name)) { UnregisterApplicationInstance(instance.Name); } _registeredApplicationInstances.Add(instance.Name, instance); try { StartInstance(instance.Name); } catch (Exception) { _registeredApplicationInstances.Remove(instance.Name); throw; } } }