////////////////////////////////////////////////////////////////////////// public void SaveSettings(SettingsNode RootNode) { SettingsNode Section = RootNode.GetNode("General", true, true); if (Section == null) { return; } Section.Clear(); Section.SetValue("SelectionColor", SelectionColor); Section.SetValue("BoxColor", BoxColor); Section.SetValue("BackgroundColor", WindowCanvas.BackColor); Section.SetValue("GridWidth", GridSize.Width); Section.SetValue("GridHeight", GridSize.Height); SettingsNode RecentList = new SettingsNode("RecentFiles"); foreach (string RecentFile in _RecentFiles) { RecentList.Children.Add(new SettingsNode("RecentFile", RecentFile)); } Section.Children.Add(RecentList); }
////////////////////////////////////////////////////////////////////////// private void SaveSettings(SettingsNode RootNode) { SettingsNode Section = RootNode.GetNode(this.Name, true, true); if (Section == null) { return; } Section.Clear(); Section.SetValue("ProjectFile", TxtProjectFile.Text); Section.SetValue("ScriptExtensions", TxtExtensions.Text); foreach (IntegratorModule Mod in modules) { Mod.SaveSettings(Section); } }
////////////////////////////////////////////////////////////////////////// public virtual void SaveControlLayout(SettingsNode RootNode) { SettingsNode Node = RootNode.GetNode(this.Name, false, true); if (Node != null) { for (int i = 0; i < Columns.Count; i++) { Node.SetValue("Col" + i.ToString() + "Width", Columns[i].Width); } } }
////////////////////////////////////////////////////////////////////////// public void SaveSettings(SettingsNode RootNode) { SettingsNode Section = RootNode.GetNode("StringTableMgr", true, true); if (Section == null) { return; } Section.Clear(); Section.SetValue("ProjectFile", ProjectFile); Section.SetValue("StringTableFile", StringTableFile); Section.SetValue("BackupOldFiles", BackupOldFiles); SettingsNode IgnoreItems = new SettingsNode("IgnoreList"); foreach (string Item in IgnoreList) { IgnoreItems.Children.Add(new SettingsNode("Item", Item)); } Section.Children.Add(IgnoreItems); }
////////////////////////////////////////////////////////////////////////// private void OnFormClosing(object sender, FormClosingEventArgs e) { SettingsNode Node = AppMgr.Settings.GetNode("Layout\\" + this.Name, false, true); if (Node != null) { Node.SetValue("FormTopMost", this.TopMost); } SaveLayout(AppMgr.Settings); AppMgr.Settings.SaveToXmlFile(); // save watches to project's registry try { string RegPath = _Client.Server.GetPropString("RegistryPath"); RegPath += @"\Debug"; using (RegistryKey Key = Registry.CurrentUser.OpenSubKey(RegPath, true)) { int OrigNumWatches = int.Parse(Key.GetValue("NumWatches", 0).ToString()); string[] WatchNames = Watch.GetWatchNames(); int i = 1; foreach (string WatchName in WatchNames) { Key.SetValue("Watch" + i.ToString(), WatchName); i++; } Key.SetValue("NumWatches", WatchNames.Length); for (i = WatchNames.Length + 1; i <= OrigNumWatches; i++) { Key.DeleteValue("Watch" + i.ToString(), false); } } } catch { } this.Visible = false; e.Cancel = true; }
////////////////////////////////////////////////////////////////////////// override public void SaveSettings(SettingsNode RootNode) { RootNode.SetValue("GeshiOutputDir", TxtOutputDir.Text); }