private static void SetMetaDataSection(Type cmdLineObjType, ChoObjectInfo objectInfo) { if (cmdLineObjType == null) { return; } string elementPath = cmdLineObjType.Name; using (ChoXmlDocument xmlDocument = new ChoXmlDocument(_metaDataFilepath)) { if (elementPath.IsNullOrEmpty()) { return; } XmlNode node = xmlDocument.XmlDocument.SelectSingleNode(elementPath); if (node == null) { node = xmlDocument.XmlDocument.MakeXPath(elementPath); } if (node != null) { xmlDocument.XmlDocument.InnerXml = ChoXmlDocument.AppendToInnerXml(node, objectInfo.ToXml()); xmlDocument.Save(); } } }
private static void SetMetaDataSection(ChoCommandLineArgObject cmdLineArgObject, ChoPropertyInfos propertyInfos) { return; if (cmdLineArgObject == null) { return; } string elementPath = cmdLineArgObject.GetType().Name; using (ChoXmlDocument xmlDocument = new ChoXmlDocument(_metaDataFilepath)) { if (elementPath.IsNullOrEmpty()) { return; } XmlNode node = xmlDocument.XmlDocument.SelectSingleNode(elementPath); if (node == null) { node = xmlDocument.XmlDocument.MakeXPath(elementPath); } if (node != null) { xmlDocument.XmlDocument.InnerXml = ChoXmlDocument.AppendToInnerXml(node, propertyInfos.ToXml()); xmlDocument.Save(); } } }
public static void SetMetaDataSection(ChoBaseConfigurationElement configElement) { if (configElement == null) { return; } if (ChoObject.Equals <ChoBaseConfigurationMetaDataInfo>(configElement.MetaDataInfo, GetMetaDataSection(configElement))) { return; } string configElementPath = configElement.ConfigElementPath; ChoBaseConfigurationMetaDataInfo configurationMetaDataInfo = configElement.MetaDataInfo; configurationMetaDataInfo = ChoObject.Merge <ChoBaseConfigurationMetaDataInfo>(configurationMetaDataInfo, GetDefaultMetaDataInfo(configElement)); if (configurationMetaDataInfo == null) { return; } using (ChoXmlDocument xmlDocument = new ChoXmlDocument(_metaDataFilepath)) { if (configElementPath.IsNullOrEmpty()) { return; } XmlNode node = xmlDocument.XmlDocument.SelectSingleNode(configElementPath); if (node == null) { node = xmlDocument.XmlDocument.MakeXPath(configElementPath); } if (node != null) { ChoXmlDocument.SetOuterXml(node, configurationMetaDataInfo.ToXml()); xmlDocument.XmlDocument.InnerXml = ChoXmlDocument.AppendToInnerXml(node, GetPropertyInfos(configElement).ToXml()); xmlDocument.Save(); } } }