public static void SaveConfiguration(Configuration configuration, string path)
 {
     lock (LockObject)
     {
         SaveConfigurationInternal(configuration, path);
     }
 }
 private static void SaveConfigurationInternal(Configuration configuration, string path)
 {
     EnsureFolder(path);
     using (var writer = XmlWriter.Create(path, new XmlWriterSettings { Indent = true }))
     {
         var serializer = new DataContractSerializer(configuration.GetType());
         serializer.WriteObject(writer, configuration);
     }
 }