示例#1
0
 public override void Closing()
 {
     DGVSaveColumnLayout(dataGridView, DbColumnSave);
     SQLiteConnectionUser.PutSettingInt(DbCM1, comboBoxCustomCM1.SelectedIndex);
     SQLiteConnectionUser.PutSettingInt(DbCM2, comboBoxCustomCM2.SelectedIndex);
     SQLiteConnectionUser.PutSettingInt(DbCMANDOR, comboBoxCustomCMANDOR.SelectedIndex);
 }
示例#2
0
 public override void Closing()
 {
     uctg.OnTravelSelectionChanged -= Uctg_OnTravelSelectionChanged;
     computer.ShutDown();
     SQLiteConnectionUser.PutSettingDouble(DbSave + "MapMin", textMinRadius.Value);
     SQLiteConnectionUser.PutSettingDouble(DbSave + "MapMax", textMaxRadius.Value);
     SQLiteConnectionUser.PutSettingInt(DbSave + "MapMaxItems", maxitems);
 }
示例#3
0
 internal void SaveCurrentPopouts()
 {
     foreach (int i in Enum.GetValues(typeof(PopOutControl.PopOuts)))
     {
         UserControlCommonBase ctrl = Create((PopOuts)i);
         int numopened = ctrl == null ? 0 : usercontrolsforms.CountOf(ctrl.GetType());
         SQLiteConnectionUser.PutSettingInt("SavedPopouts:" + ((PopOuts)i).ToString(), numopened);
     }
 }
示例#4
0
        public void DGVSaveColumnLayout(DataGridView dgv, string root)
        {
            for (int i = 0; i < dgv.Columns.Count; i++)
            {
                string k = root + (i + 1).ToString();
                SQLiteDBClass.PutSettingInt(k, dgv.Columns[i].Width);
                //System.Diagnostics.Debug.WriteLine("Save {0} {1} {2}", Name, k, dgv.Columns[i].Width);
            }

            SQLiteConnectionUser.PutSettingInt(root + "HW", dgv.RowHeadersWidth);
        }
示例#5
0
        internal void SaveCurrentPopouts()
        {
            foreach (int i in Enum.GetValues(typeof(PanelInformation.PanelIDs)))        // in terms of PanelInformation.PopOuts Enum
            {
                PanelInformation.PanelIDs p = (PanelInformation.PanelIDs)i;

                UserControlCommonBase ctrl = PanelInformation.Create(p);
                int numopened = ctrl == null ? 0 : usercontrolsforms.CountOf(ctrl.GetType());
                SQLiteConnectionUser.PutSettingInt("SavedPanelInformation.PopOuts:" + ((PanelInformation.PanelIDs)i).ToString(), numopened);
            }
        }
示例#6
0
 internal void SaveCurrentPopouts()
 {
     foreach (PanelInformation.PanelIDs p in Enum.GetValues(typeof(PanelInformation.PanelIDs)))        // in terms of PanelInformation.PopOuts Enum
     {
         PanelInformation.PanelInfo pi = PanelInformation.GetPanelInfoByPanelID(p);
         if (pi != null) // paranoia
         {
             int numopened = usercontrolsforms.CountOf(pi.PopoutType);
             //System.Diagnostics.Debug.WriteLine("Saved panel type " + paneltype.Name + " " + p.ToString() + " " + numopened);
             SQLiteConnectionUser.PutSettingInt("SavedPanelInformation.PopOuts:" + p.ToString(), numopened);
         }
     }
 }
示例#7
0
 public void SaveCurrentPopouts()
 {
     foreach (PanelInformation.PanelIDs p in Enum.GetValues(typeof(PanelInformation.PanelIDs)))        // in terms of PanelInformation.PopOuts Enum
     {
         PanelInformation.PanelInfo pi = PanelInformation.GetPanelInfoByPanelID(p);
         if (pi != null) // paranoia
         {
             int numopened = usercontrolsforms.CountOf(pi.PopoutType);
             if (numopened > 0)
             {
                 System.Diagnostics.Debug.WriteLine($"Save Popout {p} {numopened}");
             }
             SQLiteConnectionUser.PutSettingInt(PopOutSaveID(p), numopened);
         }
     }
 }
        private void Selection_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem tsmi = sender as ToolStripMenuItem;
            SelectionBits     sel  = (SelectionBits)(tsmi.Tag); // tag contains bit number

            SelectionBits cur = (SelectionBits)SQLiteConnectionUser.GetSettingInt(DBSelections, (int)SelectionBits.Default);

            cur = (cur & ~sel);
            if (tsmi.Checked)
            {
                cur |= sel;
            }
            SQLiteConnectionUser.PutSettingInt(DBSelections, (int)cur);

            System.Diagnostics.Debug.WriteLine("Mission overal sel code " + cur);
            Display(currentHE);
        }
示例#9
0
 public override void Closing()
 {
     SQLiteConnectionUser.PutSettingInt(DbSelectedSave, tabStrip.SelectedIndex);
     tabStrip.Close();
 }
示例#10
0
 private bool PutSettingInt(string key, int value)
 {
     return(PutSetting <int>(key, value, (k, v) => SQLiteConnectionUser.PutSettingInt(k, v)));
 }
示例#11
0
        public bool UpdateProfiles(List <Profile> newset, int poweronindex)        // true reload - Current is invalid if true, must reload to new profile
        {
            List <Profile> toberemoved = new List <Profile>();

            foreach (Profile p in ProfileList)
            {
                Profile c = newset.Find(x => x.Id == p.Id);

                if (c == null)         // if newset does not have this profile ID
                {
                    toberemoved.Add(p);
                }
                else
                {                             // existing in both, update
                    System.Diagnostics.Debug.WriteLine("Update ID " + p.Id);
                    p.Name          = c.Name; // update name and condition
                    p.TripCondition = c.TripCondition;
                    p.BackCondition = c.BackCondition;
                }
            }

            bool removedcurrent = false;

            foreach (Profile p in toberemoved)
            {
                if (Object.ReferenceEquals(Current, p))
                {
                    removedcurrent = true;
                }

                System.Diagnostics.Debug.WriteLine("Delete ID " + p.Id);
                SQLiteConnectionUser.DeleteKey(ProfilePrefix(p.Id) + "%");       // all profiles string
                ProfileList.Remove(p);
            }

            foreach (Profile p in newset.Where((p) => p.Id == -1))
            {
                int[] curids = (from x in ProfileList select x.Id).ToArray();

                int id = DefaultId + 1;
                for (; id < 10000; id++)
                {
                    if (Array.IndexOf(curids, id) == -1)
                    {
                        break;
                    }
                }

                System.Diagnostics.Debug.WriteLine("Make ID " + id);
                p.Id = id;
                ProfileList.Add(p);
            }

            poweronindex = poweronindex >= 0 ? poweronindex : 0;
            SQLiteConnectionUser.PutSettingInt("ProfilePowerOnID", ProfileList[poweronindex].Id);
            PowerOn = ProfileList[poweronindex];

            SaveProfiles();
            History.Clear();        // because an ID may have gone awol

            return(removedcurrent);
        }