public void RemoveIndexLocation(object o) { if (CanRemoveIndexLocation()) { using (var dialog = new TaskDialog()) { dialog.WindowTitle = "Remove Index Location"; dialog.MainInstruction = "Are you sure you want to remove the selected index location?"; dialog.Content = "This location will not be indexed anymore."; dialog.ButtonStyle = TaskDialogButtonStyle.CommandLinks; var removeButton = new TaskDialogButton("Remove") { CommandLinkNote = "Yes, remove it" }; dialog.Buttons.Add(removeButton); dialog.Buttons.Add(new TaskDialogButton(ButtonType.Cancel)); var result = dialog.ShowDialog(); if (result == removeButton) { IndexLocations.Remove(SelectedIndexLocation); } } } }
public void AddIndexLocation(object o) { var dialog = new VistaFolderBrowserDialog { Description = "Select Index Location", UseDescriptionForTitle = true, }; var result = dialog.ShowDialog(); if (result.HasValue && result.Value) { if (!IndexLocations.Contains(dialog.SelectedPath)) { IndexLocations.Add(dialog.SelectedPath); } SelectedIndexLocation = dialog.SelectedPath; } }
public void UpdateSettings(SettingsData settingsData) { Settings.IndexLocations = IndexLocations.ToArray(); settingsData.ApplicationLauncherSettings = Settings; }