Пример #1
0
 public bool SaveXml <TKey, TValue>(XmlConfigFile <TKey, TValue> file, bool constConfig) where TValue : class
 {
     if (overrideModule != null)
     {
         return(overrideModule.SaveXml(file, constConfig));
     }
     if (readerModule is XmlConfigReaderModule)
     {
         return((readerModule as XmlConfigReaderModule).SaveXml(file, constConfig));
     }
     return(false);
 }
Пример #2
0
        public bool SaveXml <TKey, TValue>(XmlConfigFile <TKey, TValue> file, bool constConfig) where TValue : class
        {
            IXmlConfigDictionary xmlDict = GetXmlDataCollection(typeof(TValue), typeof(TKey), constConfig);

            if (!string.IsNullOrEmpty(file.OriginPath) && file.OriginPath != file.Path)
            {
                xmlDict.DeleteFile(file.OriginPath);
            }
            if (!string.IsNullOrEmpty(file.Path))
            {
                return(xmlDict.SaveToFile <TValue>(file.Path, file.Data));
            }
            return(true);
        }