config: throw exception whenever config file doesn't exist
This commit is contained in:
parent
83ca2008e8
commit
67cfffc4d4
|
@ -49,7 +49,7 @@ namespace SparkleLib {
|
|||
XmlNode node = SelectSingleNode ("//user/name/text()");
|
||||
node.InnerText = value;
|
||||
|
||||
Save (Path);
|
||||
Save ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ namespace SparkleLib {
|
|||
XmlNode node = SelectSingleNode ("//user/name/email()");
|
||||
node.InnerText = value;
|
||||
|
||||
Save (Path);
|
||||
Save ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ namespace SparkleLib {
|
|||
XmlNode node_root = SelectSingleNode ("/");
|
||||
node_root.AppendChild (node_folder);
|
||||
|
||||
Save (Path);
|
||||
Save ();
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,7 +96,16 @@ namespace SparkleLib {
|
|||
SelectSingleNode ("/").RemoveChild (node_folder);
|
||||
}
|
||||
|
||||
Save (Path);
|
||||
Save ();
|
||||
}
|
||||
|
||||
|
||||
public void Save ()
|
||||
{
|
||||
if (!File.Exists (Path))
|
||||
throw new ConfigFileNotFoundException (Path + " does not exist");
|
||||
|
||||
base.Save (Path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue