public static void ReadBool(this XElement config, string nodeName, Action<bool> setter)
{
var attribute = config.Attribute(nodeName);
if (attribute != null)
{
bool value;
if (bool.TryParse(attribute.Value, out value))
{
setter(value);
}
else
{
throw new WeavingException($"Could not parse '{nodeName}' from '{attribute.Value}'.");
}
}
}
}