public void GetTrackLogFilePathTest() { string expectedFilePath = "myfile.gpx"; TrackLogEvent te = new TrackLogEvent(new GRLocation(0, 0), expectedFilePath, "", ""); Assert.AreEqual(expectedFilePath, te.TrackLogFilePath); }
public void GetEndTimeStampTest() { DateTime dtEnd = DateTime.Now; TrackLogEvent te = new TrackLogEvent(new GRLocation(0, 0), "", "", dtEnd.ToString()); Assert.AreEqual(dtEnd.ToString(), te.EndTimeStamp); }
public void TrackLogEventTest() { string expectedFilePath = "myfile.gpx"; DateTime dtStart = DateTime.Now; DateTime dtEnd = DateTime.Now; TrackLogEvent te = new TrackLogEvent(new GRLocation(0, 0), expectedFilePath, dtStart.ToString(), dtEnd.ToString()); Assert.AreEqual(expectedFilePath, te.TrackLogFilePath); Assert.AreEqual(dtStart.ToString(), te.StartTimeStamp); Assert.AreEqual(dtEnd.ToString(), te.EndTimeStamp); }
private void btn_submit_Click(object sender, EventArgs e) { dt = dtPicker.Value; if (Ready()) { Event newEvent = new TrackLogEvent(new GRLocation(eventLocation.Latitude, eventLocation.Longitude), fileName, dt.ToString(), dt.ToString()); GREventManager.AddEvent(newEvent); MessageBox.Show("Event successfully added!"); this.Hide(); } else { MessageBox.Show("Could not add event."); } }
private static List <Event> GetEvents(XmlNodeList eventNodes, XmlNamespaceManager nsmgr) { List <Event> eventLog = new List <Event>(); for (int i = 0; i < eventNodes.Count; i++) { //Tweet event found XmlNode tweetEventNode = GetNodeWithTag("tweet", eventNodes[i], nsmgr); if (tweetEventNode != null) { TweetEvent tEvent = ProcessTweet(eventNodes[i], tweetEventNode, nsmgr); eventLog.Add(tEvent); } XmlNode statusEventNode = GetNodeWithTag("facebook-status-update", eventNodes[i], nsmgr); if (statusEventNode != null) { StatusUpdateEvent suEvent = ProcessStatusEvent(eventNodes[i], statusEventNode, nsmgr); eventLog.Add(suEvent); } XmlNode photoEventNode = GetNodeWithTag("photo", eventNodes[i], nsmgr); if (photoEventNode != null) { PhotoEvent pEvent = ProcessPhotoEvent(eventNodes[i], photoEventNode, nsmgr); eventLog.Add(pEvent); } XmlNode videoEventNode = GetNodeWithTag("video", eventNodes[i], nsmgr); if (videoEventNode != null) { VideoEvent vEvent = ProcessVideoEvent(eventNodes[i], videoEventNode, nsmgr); eventLog.Add(vEvent); } XmlNode trackLogEventNode = GetNodeWithTag("tracklog", eventNodes[i], nsmgr); if (trackLogEventNode != null) { TrackLogEvent tlEvent = ProcessTrackLog(eventNodes[i], trackLogEventNode, nsmgr); eventLog.Add(tlEvent); } } return(eventLog); }
public static void Write(string ns, XmlTextWriter writer, TrackLogEvent aEvent) { writer.WriteStartElement(ns + "tracklog"); writer.WriteStartElement(ns + "filepath"); writer.WriteString(aEvent.TrackLogFilePath); writer.WriteEndElement(); Write(ns, writer, aEvent.EventLocation); writer.WriteStartElement(ns + "start-time"); Write(ns, writer, aEvent.EventDateTime); writer.WriteEndElement(); writer.WriteStartElement(ns + "end-time"); Write(ns, writer, aEvent.EventDateTime); writer.WriteEndElement(); writer.WriteEndElement(); }