Ejemplo n.º 1
0
        private void OnDetectInstallations()
        {
            try
            {
                var installations      = InstallationLocator.Locate();
                var addedInstallations = new List <string>();

                foreach (var installation in installations)
                {
                    if (Installations.All(i => i.ToString() != installation.ToString()))
                    {
                        Installations.Add(new InstallLocationModel(installation));
                        addedInstallations.Add(installation.Directory);
                    }
                }

                foreach (var directory in addedInstallations)
                {
                    _settingsService.AddInstalls(directory);
                }
            }
            catch (Exception e)
            {
                GeneralExceptionHandler.Instance.OnError(e);
            }
        }