Esempio n. 1
0
 public void SaveXmlConfiguration(XmlConfigurationMessage serviceConfiguration)
 {
     if (serviceConfiguration.JeepConfig != null)
     {
         File.WriteAllText(serviceConfiguration.JeepConfigPath, serviceConfiguration.JeepConfig.ToString());
     }
 }
Esempio n. 2
0
        public XmlConfigurationMessage LoadXmlConfiguration(string serviceConfigurationFullPath)
        {
            var result = new XmlConfigurationMessage();

            if (!String.IsNullOrEmpty(serviceConfigurationFullPath))
            {
                if (!File.Exists(serviceConfigurationFullPath))
                {
                    throw new FileNotFoundException("Impossibile trovare il file di configurazione JeepConfig.xml.", serviceConfigurationFullPath);
                }
                var serializer = new XmlSerializer(typeof(VecompSoftware.JeepService.Common.Configuration));
                using (Stream stream = new FileStream(serviceConfigurationFullPath, FileMode.Open))
                {
                    result.JeepConfig     = (VecompSoftware.JeepService.Common.Configuration)serializer.Deserialize(stream);
                    result.JeepConfigPath = serviceConfigurationFullPath;
                }
            }
            return(result);
        }
 public void SaveXmlConfiguration(XmlConfigurationMessage serviceConfiguration)
 {
     Channel.SaveXmlConfiguration(serviceConfiguration);
 }