private void CopyBeatmapsAsUrls(object sender) { var dummyCollection = ((IBeatmapListingModel)sender).AddSelectedBeatmapsToCollection(new Collection(_osuFileIo.LoadedMaps)); Helpers.SetClipboardText(_listGenerator.GetAllMapsList(new Collections() { dummyCollection }, UserUrlListGenerator)); }
private void ModelOnCollectionChanged(object sender, EventArgs eventArgs) { CollectionListSaveType type; Enum.TryParse(_view.SelectedSaveType, out type); _view.GeneratedText = _listGenerator.GetAllMapsList(_model.Collections, type); }
private void HandleMainWindowActions(IMainFormView form) { //TODO: export Listing of maps to CollectionTextPresenter(and refactor it as needed) form.SidePanelView.ListAllMaps += delegate { var fileLocation = UserDialogs.SaveFile("Where list of all maps should be saved?", "Txt(.txt)|*.txt|Html(.html)|*.html"); if (fileLocation == string.Empty) { return; } var listGenerator = new ListGenerator(); var CollectionListSaveType = Path.GetExtension(fileLocation).ToLower() == ".txt" ? CollectionManagerExtensionsDll.Enums.CollectionListSaveType.Txt : CollectionManagerExtensionsDll.Enums.CollectionListSaveType.Html; var contents = listGenerator.GetAllMapsList(LoadedCollections, CollectionListSaveType); File.WriteAllText(fileLocation, contents); }; form.SidePanelView.ListMissingMaps += delegate { var fileLocation = UserDialogs.SaveFile("Where list of all maps should be saved?", "Txt(.txt)|*.txt|Html(.html)|*.html"); if (fileLocation == string.Empty) { return; } var listGenerator = new ListGenerator(); var CollectionListSaveType = Path.GetExtension(fileLocation).ToLower() == ".txt" ? CollectionManagerExtensionsDll.Enums.CollectionListSaveType.Txt : CollectionManagerExtensionsDll.Enums.CollectionListSaveType.Html; var contents = listGenerator.GetMissingMapsList(LoadedCollections, CollectionListSaveType); File.WriteAllText(fileLocation, contents); }; }
private void ListAllBeatmaps(object sender, object data = null) { var fileLocation = _userDialogs.SaveFile("Where list of all maps should be saved?", "Txt(.txt)|*.txt|Html(.html)|*.html"); if (fileLocation == string.Empty) { return; } var listGenerator = new ListGenerator(); var CollectionListSaveType = Path.GetExtension(fileLocation).ToLower() == ".txt" ? CollectionManagerExtensionsDll.Enums.CollectionListSaveType.Txt : CollectionManagerExtensionsDll.Enums.CollectionListSaveType.Html; var contents = listGenerator.GetAllMapsList(Initalizer.LoadedCollections, CollectionListSaveType); File.WriteAllText(fileLocation, contents); }