//Set values in Events1 class public void SetEvents1(string key, XElement sr) { if (key.Equals("eventid")) { obj1.setEventID(sr.Value); } else if (key.Equals("text")) { obj1.setText(sr.Value); } else if (key.Equals("lat")) { obj1.setLatitude(sr.Value); } else if (key.Equals("long")) { obj1.setLongitude(sr.Value); } else if (key.Equals("datetimestamp")) { obj1.setDateTimeStamp(sr.Value); } }
private void SubmitButton_Click(object sender, EventArgs e) { string text = textBox1.Text; string date = Convert.ToString(dateTimePicker1.Value); this.Hide(); var eventCounter = Dic1.Count + Dic2.Count + 2; //Write to xml file WriteToXML(text, date, eventCounter + 1, eve_type, X, Y); //Set event information into Events1 class Events1 obj = new Events1(); obj.setText(text); obj.setDateTimeStamp(date); obj.setEventID(("ID" + (eventCounter + 1))); obj.setEventType(eve_type); obj.setLatitude(Convert.ToString(X)); obj.setLongitude(Convert.ToString(Y)); Dic1.Add(("ID" + (eventCounter + 1)), obj); ChoiceForm f2 = new ChoiceForm(); //Set values into dictionary Database db = new Database(); db.setDictionaries(Dic1, Dic2); f2.setTwitterFBFlag(true); }