private void PomaMobile_Closing(object sender, CancelEventArgs e) { if (gps != null && gps.Opened) { gps.Close(); } }
private void menuItem1_Click(object sender, EventArgs e) { if (gps.Opened) { gps.Close(); } this.Dispose(); this.Close(); }
private void exitMenuItem_Click(object sender, EventArgs e) { if (gps.Opened) { gps.Close(); } Close(); }
private void Form1_Closing(object sender, CancelEventArgs e) { if (gps.Opened) { gps.DeviceStateChanged -= gps_DeviceStateChanged; gps.LocationChanged -= gps_LocationChanged; gps.Close(); } }
private void exitMenuItem_Click(object sender, EventArgs e) { if (gps.Opened) { gps.Close(); } CloseCOM(); CloseStream(); Application.Exit(); }
private void menuItemGPSenabled_Click(object sender, EventArgs e) { menuItemGPSenabled.Checked = !menuItemGPSenabled.Checked; if (!menuItemGPSenabled.Checked) { if (gps.Opened) { gps.Close(); SetOffGPSPower(); } count = 0; countReal = 0; Total = 0; { TimeUTC = null; Lat = null; Lng = null; Delta = 0; } lock (Satellites) { Satellites.Clear(); Satellites.TrimExcess(); } if (Controls.Contains(pageGps)) { pageGps.panelSignals.Invalidate(); } TryCommitData(); gpsPos.Pen.Color = Color.Blue; } else // start tracking { gpsPos.Pen.Color = Color.Red; gpsPos.IsVisible = true; if (!gps.Opened) { gps.Open(); SetOnGPSPower(); } } }
//close gps public void close() { isClosingGps = true; parentForm.gpsStatus = Form1.GpsStatus.GPS_CLOSE; if (gps.Opened) { gpsEvents.newLocationReceived -= gpsEvents.Form1_NewLocationReceived; gps.LocationChanged -= gpsEvents.gps_LocationChanged; gps.Close(); } }
private void GPSMenuItem_Click(object sender, EventArgs e) { if (!gps.Opened) { updateDataHandler = new EventHandler(UpdateData); gps.LocationChanged += new LocationChangedEventHandler(gps_LocationChanged); // location changed is an event gps.Open(); GPSMenuItem.Text = "Turn Gps Off"; } else { gps.LocationChanged -= gps_LocationChanged; gps.Close(); GPSMenuItem.Text = " Turn Gps On"; Reminder_Occurs = false; } }
private void gpsCloseMenuItem_Click(object sender, EventArgs e) { if (!_gps.Opened) { PrintLn("GPS is not open"); } else { //UninitGps(); _gps.Close(); PrintLn("Closed GPS"); } }