Beispiel #1
0
 public override bool Execute()
 {
     ConfigDocument = XDocument.Load(new StringReader(File.ReadAllText(ConfigFilePath)));
     if (!String.IsNullOrEmpty(JobSystemConnectionString))
     {
         var elem = ConfigDocument.Descendants("connectionStrings").Elements().Where(e => e.Attribute("name").Value == "JobSystem").Single();
         elem.Attribute("connectionString").Value = JobSystemConnectionString;
     }
     if (!String.IsNullOrEmpty(UseRemoteConnection))
     {
         var elem = ConfigDocument.Descendants("appSettings").Elements().Where(e => e.Attribute("key").Value == "UseRemoteConfiguration").Single();
         elem.Attribute("value").Value = UseRemoteConnection;
     }
     ConfigDocument.Save(ConfigFilePath);
     return(true);
 }