Ejemplo n.º 1
0
        /// <inheritdoc />
        public void RegisterApplicationInstance(ApplicationInstanceDescription instance)
        {
            if (instance == null)
            {
                throw new ArgumentNullException(nameof(instance));
            }

            _internalWatchdog.RegisterApplicationInstance(instance);
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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;
                }
            }
        }