Пример #1
0
 private void gMap_mapa_OnMarkerClick(GMapMarker item, MouseEventArgs e)
 {
     try
     {
         if (stopPress == true)
         {
             //timer.Stop();
             if (e.Button == MouseButtons.Left)
             {
                 int index = Convert.ToInt32(item.Tag);
                 List <PointLatLng> listaCoordenades = createListCoordenadas(index);
                 if (listFLights[index].CAT == 10)
                 {
                     CAT10_INFOFLIGHT cat10_infoflight = new CAT10_INFOFLIGHT(listaCAT10[listFLights[index].realindex], listaCoordenades);
                     cat10_infoflight.Show();
                 }
                 else if (listFLights[index].CAT == 20)
                 {
                     CAT20_INFOFLIGHT cat20_infoflight = new CAT20_INFOFLIGHT(listaCAT20[listFLights[index].realindex], listaCoordenades);
                     cat20_infoflight.Show();
                 }
                 else if (listFLights[index].CAT == 21)
                 {
                     CAT21_INFOFLIGHT cat21_infoflight = new CAT21_INFOFLIGHT(listaCAT21[listFLights[index].realindex], listaCoordenades);
                     cat21_infoflight.Show();
                 }
             }
             else if (e.Button == MouseButtons.Right)
             {
                 int index = Convert.ToInt32(item.Tag);
                 dataGridView_flights.ClearSelection();
                 dataGridView_flights.Rows[index].Selected = true;
             }
         }
         else
         {
             MessageBox.Show("Please, stop simulation to view more flight information!");
         }
     }
     catch (Exception k)
     {
         MessageBox.Show(k.Message);
     }
 }
Пример #2
0
 private void dataGridView_flights_CellDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     try
     {
         if (stopPress == true)
         {
             int fila = dataGridView_flights.CurrentCell.RowIndex;
             List <PointLatLng> listaCoordenades = createListCoordenadas(fila);
             if (e.Button == MouseButtons.Left)
             {
                 if (listFLights[fila].CAT == 10)
                 {
                     CAT10_INFOFLIGHT cat10_infoflight = new CAT10_INFOFLIGHT(listaCAT10[listFLights[fila].realindex], listaCoordenades);
                     cat10_infoflight.Show();
                 }
                 else if (listFLights[fila].CAT == 20)
                 {
                     CAT20_INFOFLIGHT cat20_infoflight = new CAT20_INFOFLIGHT(listaCAT20[listFLights[fila].realindex], listaCoordenades);
                     cat20_infoflight.Show();
                 }
                 else if (listFLights[fila].CAT == 21)
                 {
                     CAT21_INFOFLIGHT cat21_infoflight = new CAT21_INFOFLIGHT(listaCAT21[listFLights[fila].realindex], listaCoordenades);
                     cat21_infoflight.Show();
                 }
             }
             else if (e.Button == MouseButtons.Right)
             {
                 /*Bitmap bmpMarker = (Bitmap)Image.FromFile("avion-amarillo.png");
                  * GMapMarker marker = new GMarkerGoogle(listFLights[i].punto, bmpMarker);
                  * markers.Markers.Add(marker);
                  * gMap_mapa.Overlays.Add(markers);*/
             }
         }
         else
         {
             MessageBox.Show("Please, stop simulation to view more flight information!");
         }
     }
     catch (Exception h)
     {
         MessageBox.Show(h.Message);
     }
 }