private async void UpdateComboBox(string systemName, HistoryList helist)
        {
            ISystem thisSystem = helist.FindSystem(systemName);

            BodyName.Items.Clear();
            if (thisSystem != null)
            {
                var lookup = await helist.StarScan.FindSystemAsync(thisSystem, true);
                var landables = lookup?.Bodies?.Select(b => b.CustomNameOrOwnname );        // lets present all, even if not landable, as you may want a whole planet bookmark

                if (landables != null)
                {
                    foreach (string s in landables)
                    {
                        //System.Diagnostics.Debug.WriteLine("Drop " + s);
                        BodyName.Items.Add(s);
                    }
                }
            }
        }
Exemple #2
0
        private async void UpdateComboBox(string systemName, HistoryList helist)
        {
            ISystem thisSystem = helist.FindSystem(systemName);

            BodyName.Items.Clear();
            if (thisSystem != null)
            {
                var lookup = await helist.starscan.FindSystemAsync(thisSystem, true);

                var landables = lookup?.Bodies?.Where(b => b.ScanData != null && b.ScanData.IsLandable)?.Select(b => b.fullname);

                if (landables != null)
                {
                    foreach (string s in landables)
                    {
                        //System.Diagnostics.Debug.WriteLine("Drop " + s);
                        BodyName.Items.Add(s);
                    }
                }
            }
        }
        private void textBox_TextChanged(object sender, EventArgs e)
        {
            if (validatestarname)
            {
                ISystem f = helist.FindSystem(textBoxName.Text, null, false);       // no edsm lookup, too slow to do interactively.
                if (f != null && f.HasCoordinate)
                {
                    InitialisePos(f);
                    var edsm = new EDSMClass();
                    edsmurl = edsm.GetUrlToSystem(f.Name);
                    SurfaceBookmarks.Init(f.Name, helist);
                }
                else
                {
                    textBoxX.Text = textBoxY.Text = textBoxZ.Text = "";
                }

                buttonEDSM.Enabled = buttonOK.Enabled = ValidateData() && f != null;
            }
            else
            {
                buttonOK.Enabled = ValidateData();
            }
        }