public LaunchProfilesEditor(Settings settings)
 {
     _manager       = new LaunchProfileManager(settings);
     LaunchProfiles = new ObservableCollection <LaunchProfile>(_manager.GetAll());
     InitializeComponent();
     ProfilesListView.SelectedIndex = LaunchProfiles.IndexOf(_manager.GetDefault());
 }
 private void ProfilesListView_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
 {
     if (!DeleteMode.IsChecked.Value)
     {
         var indexOfDefault = LaunchProfiles.IndexOf(_manager.GetDefault());
         if (ProfilesListView.SelectedIndex == indexOfDefault || ProfilesListView.SelectedIndex == -1)
         {
             return;
         }
         var selectedItem = ProfilesListView.SelectedItem as LaunchProfile;
         try
         {
             _manager.MakeDefault(selectedItem.Id);
         }
         catch (System.ArgumentException)
         {
             ProfilesListView.SelectedIndex = indexOfDefault;
         }
     }
 }