Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrpai committed Jul 1, 2023
2 parents de55e19 + 26e9701 commit 0efd41b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ public XElement GetOrCreateDirectoryComponent(string directoryPath, bool peFile
else
{
directoryComponentElement = _componentGroup.Descendants(_ns + "Component").Where(
c => c.Attribute("Directory").Value == directoryMeta.Directory && c.GetOptionalAttribute("KeyPath") == "true").FirstOrDefault();
c => c.Attribute("Directory").Value == directoryMeta.Directory && c.GetOptionalYesNoAttribute("KeyPath", false) == true).FirstOrDefault();
}
}
else
{
directoryComponentElement = _componentGroup.Descendants(_ns + "Component").Where(
c => c.Attribute("Directory").Value == directoryMeta.Directory &&
(c.GetOptionalAttribute("Subdirectory") == directoryMeta.Subdirectory)).FirstOrDefault();
(c.GetOptionalAttribute("Subdirectory") == directoryMeta.Subdirectory && c.GetOptionalYesNoAttribute("KeyPath", false) == true)).FirstOrDefault();
}

if (directoryComponentElement == null)
Expand All @@ -116,7 +116,7 @@ public XElement GetOrCreateDirectoryComponent(string directoryPath, bool peFile
new XAttribute("Id", id),
new XAttribute("Directory", directoryMeta.Directory),
new XAttribute("Guid", Guid.NewGuid().ToString()),
new XAttribute("KeyPath", "true"),
new XAttribute("KeyPath", "yes"),
new XElement(_ns + "CreateFolder"));
}
else
Expand All @@ -127,7 +127,7 @@ public XElement GetOrCreateDirectoryComponent(string directoryPath, bool peFile
new XAttribute("Directory", directoryMeta.Directory),
new XAttribute("Subdirectory", directoryMeta.Subdirectory),
new XAttribute("Guid", Guid.NewGuid().ToString()),
new XAttribute("KeyPath", "true"),
new XAttribute("KeyPath", "yes"),
new XElement(_ns + "CreateFolder"));
}
_componentGroup.Add(directoryComponentElement);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ public static bool GetOptionalYesNoAttribute(this XElement Element, string Attri
case "no":
finalValue = false;
break;
case "true":
finalValue = true;
break;

case "false":
finalValue = false;
break;
}

return finalValue;
Expand Down

0 comments on commit 0efd41b

Please sign in to comment.