mirror of https://github.com/winsw/winsw
my version of .NET doesn't seem to allow optional parameters
parent
058c39dbbd
commit
fb6f5eb7bc
|
@ -70,7 +70,12 @@ namespace winsw
|
||||||
dom.Load(BasePath + ".xml");
|
dom.Load(BasePath + ".xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
private string SingleElement(string tagName, bool optional = false)
|
private string SingleElement(string tagName)
|
||||||
|
{
|
||||||
|
return SingleElement(tagName, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string SingleElement(string tagName, Boolean optional)
|
||||||
{
|
{
|
||||||
var n = dom.SelectSingleNode("//" + tagName);
|
var n = dom.SelectSingleNode("//" + tagName);
|
||||||
if (n == null && !optional) throw new InvalidDataException("<" + tagName + "> is missing in configuration XML");
|
if (n == null && !optional) throw new InvalidDataException("<" + tagName + "> is missing in configuration XML");
|
||||||
|
|
Loading…
Reference in New Issue