private void LoadTemplates() { cbTemplate.Items.Clear(); cbTemplate.Items.Add(""); cbTemplate.SelectedIndex = 0; messageTemplate.Clear(); var node = ToolSettingsStorageFile.LoadNode( ToolSettingsStorageFile.NodeNameMessageTemplates); if (node == null || node.ChildNodes.Count == 0) { return; } foreach (XmlElement child in node.ChildNodes) { var templateName = child.Attributes["name"].Value; var templateText = child.InnerText; messageTemplate.Add(templateName, templateText); } // добавить в комбо foreach (var name in messageTemplate.Keys) { cbTemplate.Items.Add(name); } }
public void LoadScripts() { var nodeScript = ToolSettingsStorageFile.LoadNode(ToolSettingsStorageFile.NodeNameScripts); if (nodeScript == null) { return; } scripts = TerminalScript.LoadFromXml(nodeScript); }