Modify XML Layout for config.
This commit is contained in:
parent
4a0f17ecb9
commit
60713b3408
@ -199,15 +199,23 @@ public class ICASAPol
|
|||||||
string mode = modeNode.InnerText;
|
string mode = modeNode.InnerText;
|
||||||
|
|
||||||
// Load config settings
|
// Load config settings
|
||||||
XmlNode configNode = uiNode.SelectSingleNode("//ConfigSettings");
|
|
||||||
XmlNodeList nodeList = configNode.ChildNodes;
|
|
||||||
XmlNode node;
|
|
||||||
System.Collections.Specialized.NameValueCollection nvc = new System.Collections.Specialized.NameValueCollection();
|
System.Collections.Specialized.NameValueCollection nvc = new System.Collections.Specialized.NameValueCollection();
|
||||||
|
XmlNode configNode = uiNode.SelectSingleNode("//ConfigSettings");
|
||||||
|
if (configNode != null)
|
||||||
|
{
|
||||||
|
XmlNodeList nodeList = configNode.ChildNodes;
|
||||||
|
XmlNode setting;
|
||||||
|
|
||||||
for (int i=0; i<nodeList.Count; i++)
|
for (int i=0; i<nodeList.Count; i++)
|
||||||
{
|
{
|
||||||
node = nodeList[i];
|
setting = nodeList[i];
|
||||||
//Console.WriteLine(node.Name + ":"+node.InnerText);
|
XmlNode nameNode = setting.SelectSingleNode("Name");
|
||||||
nvc.Add(node.Name, node.InnerText);
|
|
||||||
|
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);
|
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++)
|
for (int i=0; i<m_nvc.Count; i++)
|
||||||
{
|
{
|
||||||
elem = doc.CreateElement(m_nvc.GetKey(i));
|
XmlElement settingElem = doc.CreateElement("Setting");
|
||||||
elem.InnerText = m_nvc.GetValues(i)[0];
|
configElem.AppendChild(settingElem);
|
||||||
configElem.AppendChild(elem);
|
|
||||||
|
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)
|
catch(Exception e)
|
||||||
|
Loading…
Reference in New Issue
Block a user