/// <summary> /// Adds the session. /// </summary> /// <param name="date">Date.</param> /// <param name="time">Time.</param> /// <param name="distance">Distance.</param> private void addSession(long date, long time, long distance) { var session = new RunSession (); session.Start = date; session.Duration = time; session.Distance = distance; this.RunSessions.Add (session); this.trans.WriteToDataFormat (this.RunSessions); }
/// <summary> /// Builds the run event. /// </summary> /// <returns>The UI run event.</returns> /// <param name="s">A run RunSession.</param> private Gtk.HBox BuildRunEvent(RunSession s) { var hbox = new Gtk.HBox(true, 5); var date = this.runFilter.FromUnixTime (s.Start); var labelHour = new Gtk.Label ("Started: " + date.Hour + ":" + date.Minute + ":" + date.Second); var labelDistance = new Gtk.Label ("Runned: " + s.Distance + " kms"); var labelDuration = new Gtk.Label ("Duration: " + TimeSpan.FromSeconds(s.Duration).ToString(@"hh\:mm\:ss")); labelHour.Show (); labelDistance.Show (); labelDuration.Show (); hbox.PackStart (labelHour, true, false, 5 ); hbox.PackStart (labelDistance, true, false, 5); hbox.PackStart (labelDuration, true, false, 5); return hbox; }