private void btn_submit_Click(object sender, EventArgs e) { fileName = txt_fileName.Text; GREventManager.ClearMap(); MapUserControl.ClearEventDisplay(); this.Hide(); }
public static void DisplayEvents(int selection) { instance.selection = selection; EventType eventsToShow = (EventType)selection; Dictionary <int, Event> map = GREventManager.GetEventMap(); instance.Map.Children.Clear(); if (eventsToShow == EventType.ALL) { foreach (KeyValuePair <int, Event> pair in map) { Pushpin pin = new Pushpin(); pin.Location = new Location(pair.Value.EventLocation.Latitude, pair.Value.EventLocation.Longitude); //Adds the pushpin to the map. instance.Map.Children.Add(pin); } } else { foreach (KeyValuePair <int, Event> pair in map) { if (pair.Value.EventType == eventsToShow.ToString()) { //The pushpin to add to the map. Pushpin pin = new Pushpin(); pin.Location = new Location(pair.Value.EventLocation.Latitude, pair.Value.EventLocation.Longitude); //Adds the pushpin to the map. instance.Map.Children.Add(pin); } } } }
private void btn_upload_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog(); fd.Filter = "Video Files(*.avi; *.mp3; *.mp4; *.wmv)|*.avi; *.mp3; *.mp4; *.wmv"; if (fd.ShowDialog() == DialogResult.OK) { string filePath = fd.FileName; fileName = Path.GetFileName(fd.FileName); System.IO.File.Copy(fd.FileName, GREventManager.GetDataPath() + fileName); } }
private void btn_load_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog(); fd.Filter = "Xml Files(*.xml;)|*.xml;"; if (fd.ShowDialog() == DialogResult.OK) { string filePath = fd.FileName; fileName = Path.GetFileName(filePath); lbl_logName.Text = fileName; GREventManager.LoadEvents(filePath); } MapUserControl.DisplayEvents(cmb_eventType.SelectedIndex); }
private void btn_submit_Click(object sender, EventArgs e) { if (Ready()) { Event newEvent = new VideoEvent(new GRLocation(eventLocation.Latitude, eventLocation.Longitude), fileName, dt.ToString(), dt.ToString()); GREventManager.AddEvent(newEvent); MessageBox.Show("Event successfully added!"); } else { MessageBox.Show("Could not add event."); } this.Hide(); }
private void btn_upload_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog(); fd.Filter = "Track Log Files(*.gpx;)|*.gpx"; if (fd.ShowDialog() == DialogResult.OK) { string filePath = fd.FileName; fileName = Path.GetFileName(fd.FileName); if (fd.FileName != Path.GetFullPath(GREventManager.GetDataPath() + fileName)) { System.IO.File.Copy(fd.FileName, GREventManager.GetDataPath() + fileName, true); dt = dtPicker.Value; } } }
private void btn_choosePhoto_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog(); fd.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp"; if (fd.ShowDialog() == DialogResult.OK) { string filePath = fd.FileName; fileName = Path.GetFileName(fd.FileName); pb_preview.Image = new Bitmap(new Bitmap(fd.FileName)); if (fd.FileName != Path.GetFullPath(GREventManager.GetDataPath() + fileName)) { System.IO.File.Copy(fd.FileName, GREventManager.GetDataPath() + fileName, true); } } }
private void btn_submit_Click(object sender, EventArgs e) { statusText = txt_statusUpdate.Text; dt = dtPicker.Value; if (Ready()) { Event newEvent = new StatusUpdateEvent(new GRLocation(eventLocation.Latitude, eventLocation.Longitude), dt.ToString(), statusText); GREventManager.AddEvent(newEvent); MessageBox.Show("Event successfully added!"); this.Hide(); } else { MessageBox.Show("Could not add event."); } }
public static void NewDocument(string fileName) { XmlTextWriter writer = new XmlTextWriter(filePathPrefix + fileName, System.Text.Encoding.UTF8); writer.Formatting = System.Xml.Formatting.Indented; writer.WriteStartDocument(); writer.WriteRaw("\n<soapenv:Envelope xmlns:soapenv = \"http://www.w3.org/2001/12/soap-envelope\" soapenv:encodingStyle = \"http://www.w3.org/2001/12/soap-encoding\">"); writer.WriteStartElement("lle", "soapenv", "http://www.xyz.org/lifelogevents"); Dictionary <int, Event> map = GREventManager.GetEventMap(); foreach (KeyValuePair <int, Event> pair in map) { Write("lle:", writer, pair.Value); } writer.WriteEndElement(); writer.WriteEndDocument(); writer.WriteRaw("</soapenv:Envelope>"); writer.Close(); }
public void GetDataPathTest() { string expectedPath = "../../../EventData/";; Assert.AreEqual(expectedPath, GREventManager.GetDataPath()); }
public void AddEventTest() { GREventManager.ClearMap(); GREventManager.AddEvent(new PhotoEvent(new GRLocation(0, 0), "", "")); Assert.IsTrue(GREventManager.GetEventMap().Count == 1); }