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 ListMissingMaps(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.GetMissingMapsList(Initalizer.LoadedCollections, CollectionListSaveType); File.WriteAllText(fileLocation, contents); }