Modify XML Layout for config.
This commit is contained in:
parent
4a0f17ecb9
commit
60713b3408
@ -197,17 +197,25 @@ public class ICASAPol
|
||||
|
||||
XmlNode modeNode = uiNode.SelectSingleNode(xpath);
|
||||
string mode = modeNode.InnerText;
|
||||
|
||||
|
||||
// Load config settings
|
||||
XmlNode configNode = uiNode.SelectSingleNode("//ConfigSettings");
|
||||
XmlNodeList nodeList = configNode.ChildNodes;
|
||||
XmlNode node;
|
||||
System.Collections.Specialized.NameValueCollection nvc = new System.Collections.Specialized.NameValueCollection();
|
||||
for (int i=0; i<nodeList.Count; i++)
|
||||
XmlNode configNode = uiNode.SelectSingleNode("//ConfigSettings");
|
||||
if (configNode != null)
|
||||
{
|
||||
node = nodeList[i];
|
||||
//Console.WriteLine(node.Name + ":"+node.InnerText);
|
||||
nvc.Add(node.Name, node.InnerText);
|
||||
XmlNodeList nodeList = configNode.ChildNodes;
|
||||
XmlNode setting;
|
||||
|
||||
for (int i=0; i<nodeList.Count; i++)
|
||||
{
|
||||
setting = nodeList[i];
|
||||
XmlNode nameNode = setting.SelectSingleNode("Name");
|
||||
|
||||
XmlNode valueNode = setting.SelectSingleNode("Value");
|
||||
|
||||
Console.WriteLine(nameNode.InnerText + ":" + valueNode.InnerText);
|
||||
nvc.Add(nameNode.InnerText, valueNode.InnerText);
|
||||
}
|
||||
}
|
||||
|
||||
UIPol uiPol = new UIPol(showInTaskBar, showSecretValue, showSecretInClearText, mode, nvc);
|
||||
|
@ -142,9 +142,17 @@ namespace Novell.CASA.CASAPolicy
|
||||
|
||||
for (int i=0; i<m_nvc.Count; i++)
|
||||
{
|
||||
elem = doc.CreateElement(m_nvc.GetKey(i));
|
||||
elem.InnerText = m_nvc.GetValues(i)[0];
|
||||
configElem.AppendChild(elem);
|
||||
XmlElement settingElem = doc.CreateElement("Setting");
|
||||
configElem.AppendChild(settingElem);
|
||||
|
||||
XmlElement nameElem = doc.CreateElement("Name");
|
||||
nameElem.InnerText = m_nvc.GetKey(i);
|
||||
settingElem.AppendChild(nameElem);
|
||||
|
||||
XmlElement valueElem = doc.CreateElement("Value");
|
||||
valueElem.InnerXml = m_nvc.GetValues(i)[0];
|
||||
settingElem.AppendChild(valueElem);
|
||||
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
|
Loading…
Reference in New Issue
Block a user