internal static void DeleteFavourite(Favourites form, Form1 form1) { ListBox favouritesListBox = form.favouritesListBox; int selectedIndex = favouritesListBox.SelectedIndex; FileListManager.DeleteExistingFavouriteFile(form1, selectedIndex); favouritesListBox.Items.Clear(); form.InitializeForm(true); if (favouritesListBox.Items.Count <= 0) { return; } if (selectedIndex < favouritesListBox.Items.Count) { favouritesListBox.SelectedIndex = selectedIndex; } else { favouritesListBox.SelectedIndex = selectedIndex - 1; } }
internal static void ShowFavourites(Form form) { Favourites favouritesWindow = new Favourites { Owner = form }; favouritesWindow.InitializeForm(false); favouritesWindow.ShowDialog(form); }
internal static void AddNewFavouriteSession(Favourites form, Form1 form1) { ListBox favouritesListBox = form.favouritesListBox; String filter = LanguageUtil.GetCurrentLanguageString("FileDialog", className); String fileName = FileUtil.GetFileNameAndPath(form1, filter, 0, "*.dps"); if (String.IsNullOrEmpty(fileName)) { return; } FileListManager.SetNewFavouriteFile(form1, ConstantUtil.sessionPrefix + fileName); favouritesListBox.Items.Clear(); form.InitializeForm(true); favouritesListBox.SelectedIndex = favouritesListBox.Items.Count - 1; }
internal static void AddNewFavourite(Favourites form, Form1 form1) { ListBox favouritesListBox = form.favouritesListBox; int defaultExtension; String defaultExtensionShortString; String filter = ExtensionManager.GetFileDialogFilter(out defaultExtension, out defaultExtensionShortString); String fileName = FileUtil.GetFileNameAndPath(form1, filter, defaultExtension, defaultExtensionShortString); if (String.IsNullOrEmpty(fileName)) { return; } FileListManager.SetNewFavouriteFile(form1, fileName); favouritesListBox.Items.Clear(); form.InitializeForm(true); favouritesListBox.SelectedIndex = favouritesListBox.Items.Count - 1; }