private void SubmitButton_Click(object sender, EventArgs e) { string date = Convert.ToString(dateTimePicker1.Value); string filepath = textBox1.Text; var eventCounter = Dic1.Count + Dic2.Count + 2; //Write to xml file WriteToXML(filepath, date, eventCounter + 1, eve_type); //Set event information into Events2 class Events2 obj = new Events2(); obj.setStartTimeStamp(date); obj.setEndTimeStamp(date); obj.setEventID(("ID" + (eventCounter + 1))); obj.setEventType(eve_type); obj.setLatitude(Convert.ToString(X)); obj.setLongitude(Convert.ToString(Y)); Dic2.Add(("ID" + (eventCounter + 1)), obj); ChoiceForm f2 = new ChoiceForm(); //Set values into dictionary Database db = new Database(); db.setDictionaries(Dic1, Dic2); f2.setPhotoVideoTracklogFlag(true); this.Hide(); }
public void OnCLick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { //Source: https://stackoverflow.com/questions/18874868/how-to-return-lat-long-with-mousemove-in-gmap-net double X = map.FromLocalToLatLng(e.X, e.Y).Lat; //To retrieve coordinates from mouse click double Y = map.FromLocalToLatLng(e.X, e.Y).Lng; ChoiceForm f3 = new ChoiceForm(); // Instantiate a Form3 object. f3.Location = new Point(300, 200); f3.Show(); // Show Form3 f3.setLatLng(X, Y); f3.setDictionary(Dic1, Dic2); //Passing dictionaries to Choice form } }