private void toolStripButtonDelete_Click(object sender, EventArgs e)
        {
            if (EDDiscovery.Forms.MessageBoxTheme.Show(_discoveryForm, "Are you sure you want to delete this route?", "Delete Route", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (DeleteIsPermanent)
                {
                    _currentRoute.Delete();
                }
                else
                {
                    _currentRoute.Name = "\x7F" + _currentRoute.Name;
                    _currentRoute.Update();
                }

                _savedRoutes.Remove(_currentRoute);
                UpdateComboBox();
                ClearRoute();
            }
        }
Exemplo n.º 2
0
        private void toolStripButtonDelete_Click(object sender, EventArgs e)
        {
            if (ExtendedControls.MessageBoxTheme.Show(ParentForm, "Are you sure you want to delete this route?", "Delete Route", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (_currentRoute.Id >= 0)
                {
                    if (DeleteIsPermanent && !EDSMClass.Expeditions.Any(r => r.Name.Equals(_currentRoute.Name)))
                    {
                        _currentRoute.Delete();
                    }
                    else
                    {   // Expeditions shouldn't use .Delete(), as LoadControl will ignorantly re-create them at next startup.
                        _currentRoute.Name = "\x7F" + _currentRoute.Name;
                        _currentRoute.Update();
                    }

                    _savedRoutes.Remove(_currentRoute);
                    UpdateComboBox();
                }

                ClearRoute();
            }
        }
Exemplo n.º 3
0
        private void toolStripButtonDelete_Click(object sender, EventArgs e)
        {
            if (ExtendedControls.MessageBoxTheme.Show(FindForm(), "Are you sure you want to delete this route?".T(EDTx.UserControlExpedition_Delete), "Warning".T(EDTx.Warning), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (currentroute.Id >= 0)
                {
                    if (currentroute.EDSM)
                    {
                        currentroute.Deleted = true;
                        currentroute.Update();
                        UpdateUndeleteMenu();
                    }
                    else
                    {
                        currentroute.Delete();
                    }

                    savedroute.Remove(currentroute);
                    UpdateComboBox();
                }

                ClearRoute();
            }
        }