void SetWeavingProps()
{
var xDocument = XDocument.Load(projectFile);
var weavingTask = xDocument.BuildDescendants("NotifyPropertyWeaverMsBuildTask.WeavingTask").FirstOrDefault();
if (weavingTask == null)
{
return;
}
TryToWeaveAllTypes = ToBool(weavingTask.Attribute("TryToWeaveAllTypes"));
CheckForEquality = ToBool(weavingTask.Attribute("CheckForEquality"));
CheckForIsChanged = ToBool(weavingTask.Attribute("CheckForIsChanged"));
ProcessFields = ToBool(weavingTask.Attribute("ProcessFields"));
EventInvokerName = (string) weavingTask.Attribute("EventInvokerName");
TargetPath = (string) weavingTask.Attribute("TargetPath");
MessageImportance = ConvertToEnum((string) weavingTask.Attribute("MessageImportance"));
var xAttribute = weavingTask.Parent.Attribute("Name");
if (xAttribute == null)
{
throw new Exception("Target node contains no 'Name' attribute.");
}
;
TargetNode = xAttribute.Value;
}