static void Main(string[] args) { try { NSApplication.Init(); NSApplication.Main(args); } catch (Exception ex) { AlertRaiser.LandApplication(ex); } }
public void CloseDialog() { if (_availablityChanged) { // Save the availabilities. App.WriteFilmFanAvailabilities(); // Trigger a local notification. string title = "Availabilities saved"; string text = $"Film fan availabilites have been saved in {AppDelegate.DocumentsFolder}."; AlertRaiser.RaiseNotification(title, text); } // Close the dialog. Presentor.DismissViewController(this); }
private void SaveFestivalData() { // Write film fan availability. WriteFilmFanAvailabilities(DocumentsFolder); // Write film ratings. WriteFilmFanFilmRatings(DocumentsFolder); // Write screening info. string screeningInfoFileName = Path.GetFileName(ScreeningInfoFile); string screeningInfosPath = Path.Combine(DocumentsFolder, screeningInfoFileName); new ScreeningInfo().WriteListToFile(screeningInfosPath, ScreeningsPlan.ScreeningInfos); // Display where the files have been stored. string title = "Festival Data Saved"; string text = $"Files of {Festival}{FestivalYear} are saved in {DocumentsFolder}"; AlertRaiser.RaiseNotification(title, text); }
private StreamReader GetStreamReader(string url) { FileStream fileStream; try { fileStream = new FileStream(url, FileMode.Open, FileAccess.Read); } catch (FileNotFoundException) { if (ListFileIsMandatory()) { string informativeText = $"We really need file {url}, but it's missing."; AlertRaiser.QuitWithAlert("Read Error", informativeText); } return(null); } catch (Exception ex) { throw new Exception(string.Format("Read error, couldn't access file {0}", url), ex); } return(new StreamReader(fileStream)); }