/* S A V E */ /*---------------------------------------------------------------------------- %%Function: Save %%Qualified: AzLog.AzLogViewSettings.Save %%Contact: rlittle Save is a little tricky. We load the settings into a new listview, which means that the taborder is the same as the column order. on save, though, the listview could have been reordered by the user, which means that the the tab order isn't necessarily the same as our column ordering. the client will tell use the tab ordering via an rgsColumns TODO: All this wacky "watch the user moving the columns" is unnecessary. Just use the DisplayIndex int he column header (see GetOrderedHeaders in ListViewSupp.cs) ----------------------------------------------------------------------------*/ public void Save() { RegistryKey rk = Settings.RkEnsure(KeySettingsParent()); // build a tab order reverse mapping int[] mpTabOrder = new int[m_pliazlvc.Count]; for (int i = 0; i < m_pliazlvc.Count; i++) mpTabOrder[m_pliazlvc[i]] = i; rk.DeleteSubKeyTree(m_sName, false); rk.Close(); rk = Settings.RkEnsure(KeySettings()); for (int i = 0; i < ColumnCount(); i++) { AzLogViewColumn azlvc = Column(i); string sKey = String.Format("{0}\\{1}", KeySettings(), azlvc.Name); Settings ste = new Settings(_rgsteeColumn, sKey, azlvc.Name); ste.SetNValue("TabOrder", mpTabOrder[i]); ste.SetNValue("Width", azlvc.Width); ste.SetNValue("DataLogColumn", ((int) azlvc.DataColumn)); ste.SetFValue("Visible", azlvc.Visible); ste.SetSValue("Title", azlvc.Title); ste.Save(); } rk.Close(); m_fDirty = false; }
private void DoSave(object sender, EventArgs e) { string sAccountName = m_ebAccountName.Text; Settings ste = new Settings(_rgsteeAccount, String.Format("Software\\Thetasoft\\AzLog\\{0}", sAccountName), sAccountName); ste.Save(); this.Close(); }