Example #1
0
        private void SaveData()
        {
            OrbsCollectionData ocd = OrbsCollection.Where(x => x.OrbsSystemName == CurrentSystem).FirstOrDefault();

            if (ocd != null)
            {
                OrbsSystemListProcessor proc = new OrbsSystemListProcessor();
                proc.AddNewSystem(CurrentSystem);

                OrbsCollectionDataSerializer ser = new OrbsCollectionDataSerializer(CurrentSystem);
                ser.Data = ocd;
                ser.Save();
                //this.DialogResult = DialogResult.OK;
            }
        }
Example #2
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            using (dlgSomethingNew dlg = new dlgSomethingNew("Orbs System"))
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    CurrentSystem = dlg.NewValue;
                    OrbsSystemListProcessor proc = new OrbsSystemListProcessor();
                    proc.AddNewSystem(CurrentSystem);

                    cmbExisting.DataSource   = proc.OrbsSystemList;
                    cmbExisting.SelectedItem = CurrentSystem;

                    OrbsCollectionData newcol = new OrbsCollectionData();
                    newcol.OrbsSystemName    = CurrentSystem;
                    newcol.OrbsMapCollection = new List <OrbsMapCollection>();
                    OrbsCollection.Add(newcol);

                    InitTable();
                }
            }
        }