private void newTripToolStripMenuItem_Click(object sender, EventArgs e) { SaveCurrentlyLoadedTrip(); var tripName = _process.CreateTrip(); if (tripName != null) { _tripData = _process.LoadTrip(tripName); UpdateDisplay(_tripData.CurrentPhoto); } }
public void Backup(TripData tripData) { const string BackupDir = ".\\Backup\\"; if (!Directory.Exists(BackupDir)) { Directory.CreateDirectory(BackupDir); } var mySerializer = new XmlSerializer(typeof(TripData)); var myWriter = new StreamWriter(BackupDir + tripData.Trip.TripName + "." + DateTime.Now.ToFileTime() + ".xml"); mySerializer.Serialize(myWriter, tripData); myWriter.Close(); }
private void TripClicked_Event(object sender, EventArgs e) { SaveCurrentlyLoadedTrip(); var tripMenuItem = (ToolStripMenuItem) sender; _tripData = _process.LoadTrip(tripMenuItem.Text); UpdateDisplay(_tripData.CurrentPhoto); }
public void SaveLoadedTrip(TripData tripData) { SavePhoto(tripData.CurrentPhoto); }