Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        //Set values in Events2 class
        public void SetEvents2(string key, XElement sr, bool flagTime1)
        {
            if (key.Equals("eventid"))
            {
                obj2.setEventID(sr.Value);
            }

            else if (key.Equals("filepath"))
            {
                obj2.setFilePath(sr.Value);
            }

            else if (key.Equals("lat"))
            {
                obj2.setLatitude(sr.Value);
            }

            else if (key.Equals("long"))
            {
                obj2.setLongitude(sr.Value);
            }
            else if (key.Equals("datetimestamp") && flagTime1 == true)
            {
                obj2.setStartTimeStamp(sr.Value);
                obj2.setEndTimeStamp(sr.Value);
                flagTime1 = false;
            }
        }