コード例 #1
0
        private void sendToCompassToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataGridViewRow dr = dataGridViewMarks.SelectedCells.Cast <DataGridViewCell>()
                                 .Select(cell => cell.OwningRow)
                                 .FirstOrDefault();

            if (dr != null)
            {
                if (dr.Tag == null && ValidRow(dr))
                {
                    SaveLocation(dr);
                }

                if (thisBookmark != null && dr.Tag != null)
                {
                    if (Edited)
                    {
                        GlobalBookMarkList.Instance.AddOrUpdateBookmark(thisBookmark, true, thisBookmark.StarName, thisBookmark.x, thisBookmark.y, thisBookmark.z, thisBookmark.Time, thisBookmark.Note, internalPlanetMarks);
                        Edited = false;
                    }

                    UserControlCompass comp = (UserControlCompass)EDDApplicationContext.EDDMainForm.PopOuts.PopOut(PanelInformation.PanelIDs.Compass);
                    comp.SetSurfaceBookmark(thisBookmark, dr.Cells[0].Value.ToString(), dr.Cells[1].Value.ToString());
                }
            }
        }
コード例 #2
0
        private void CompassSelected(string planet, string locname)
        {
            if (currentedit != null)      // if we have a current cell..
            {
                BookmarkClass bk = (BookmarkClass)currentedit.Tag;

                UserControlCompass comp = (UserControlCompass)EDDApplicationContext.EDDMainForm.PopOuts.PopOut(PanelInformation.PanelIDs.Compass);
                comp.SetSurfaceBookmark(bk, planet, locname);
            }
        }