section.ConfigHost = system.Host;
parentGroup.AddChild (section);
elementData [section] = sec;
+
+ sec.Initialize (this, section);
}
internal void RemoveConfigInfo (ConfigInfo config)
try {
Save (stream, mode, forceUpdateAll);
system.Host.WriteCompleted (streamName, true, ctx);
- } catch (Exception ex) {
+ } catch (Exception) {
system.Host.WriteCompleted (streamName, false, ctx);
throw;
} finally {
{
SaveAs (filename, mode, false);
}
-
- [MonoTODO ("Detect if file has changed")]
+
+ [MonoInternalNote ("Detect if file has changed")]
public void SaveAs (string filename, ConfigurationSaveMode mode, bool forceUpdateAll)
{
+ string dir = Path.GetDirectoryName (Path.GetFullPath (filename));
+ if (!Directory.Exists (dir))
+ Directory.CreateDirectory (dir);
Save (new FileStream (filename, FileMode.OpenOrCreate, FileAccess.Write), mode, forceUpdateAll);
}
XmlTextReader reader = null;
Stream stream = null;
+ // FIXME: we should remove this kind of hack that
+ // hides the actual error
try {
stream = system.Host.OpenStreamForRead (streamName);
- } catch (Exception e) {
+ } catch (Exception) {
return false;
}