Пример #1
0
        private void newTripToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveCurrentlyLoadedTrip();

            var tripName = _process.CreateTrip();
            if (tripName != null)
            {
                _tripData = _process.LoadTrip(tripName);
                UpdateDisplay(_tripData.CurrentPhoto);
            }
        }
Пример #2
0
        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();
        }
Пример #3
0
        private void TripClicked_Event(object sender, EventArgs e)
        {
            SaveCurrentlyLoadedTrip();

            var tripMenuItem = (ToolStripMenuItem) sender;
            _tripData = _process.LoadTrip(tripMenuItem.Text);
            UpdateDisplay(_tripData.CurrentPhoto);
        }
Пример #4
0
 public void SaveLoadedTrip(TripData tripData)
 {
     SavePhoto(tripData.CurrentPhoto);
 }