private void ClickElement(object sender, PictureBoxHotspot.ImageElement i , object tag) { if (i != null) ShowInfo((string)tag, i.pos.Location.X < panelStars.Width / 2); else HideInfo(); }
private void pictureBox_ClickElement(object sender, MouseEventArgs e, PictureBoxHotspot.ImageElement i, object tag) { if (i != null) { string stag = tag as string; HistoryEntry he = tag as HistoryEntry; if (stag != null) // its SCAN for now { HideScanData(null, null); } else if (he != null) { EDDiscovery2.EDSM.EDSMClass edsm = new EDDiscovery2.EDSM.EDSMClass(); string url = edsm.GetUrlToEDSMSystem(he.System.name); if (url.Length > 0) // may pass back empty string if not known, this solves another exception System.Diagnostics.Process.Start(url); else MessageBox.Show("System " + he.System.name + " unknown to EDSM"); } } else System.Diagnostics.Debug.WriteLine("Clicked at " + e.X + " " + e.Y ); }