Exemplo n.º 1
0
        //execute if location is changed to update form component and save data to database
        public void Form1_NewLocationReceived(object sender, LocationChangedEventArgs e)
        {
            if (!gpsConnector.isClosingGps)
            {
                GpsPosition position = e.Position;
                try
                {
                    //check gps connection - if gps not open then open gps
                    gpsConnector.openGps();

                    //retrive position to save gps data to database
                    gpsConnector.retrivePosition(position);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("new loc" + ex.Message);
                }
            }
        }