private void ResetShortcuts() { Shortcuts.Clear(); for (int i = 0; i < 6; ++i) { SShortcut sc = new SShortcut(); sc.Exec = ""; sc.Args = ""; sc.Name = "Shortcut" + i.ToString(); sc.myID = i; Shortcuts.Add(sc); } }
private void LoadShortcutsFromFile() { XmlTextReader reader = new XmlTextReader(m_sShortcutsSavePath); if (reader != null) { Shortcuts.Clear(); while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element && reader.LocalName == "Shortcut") { reader.MoveToAttribute("id"); int id = int.Parse(reader.Value); if (id >= 0 && id < 6) { SShortcut sc = new SShortcut(); sc.myID = id; reader.MoveToAttribute("name"); sc.Name = reader.Value; reader.MoveToAttribute("exec"); sc.Exec = reader.Value; reader.MoveToAttribute("args"); sc.Args = reader.Value; Shortcuts.Add(sc); } } } reader.Close(); } }