Didn't test the AncestorOrSelf changes on a non-parent node. Changed implementation to call into Func<DynamicNode,bool> to check Level == 1

Also fixed post-build rule on umbraco.MacroEngines which had an incorrect path for copying umbraco.MacroEngines to presentation (allows debug without manual file copy, I think)
This commit is contained in:
agrath@gmail.com
2011-01-27 13:07:10 -13:00
parent fbf13d8cf7
commit fce7ea48b0
2 changed files with 2 additions and 23 deletions

View File

@@ -249,28 +249,7 @@ namespace umbraco.MacroEngines
}
public DynamicNode AncestorOrSelf()
{
var node = this;
while (node != null)
{
DynamicNode parent = node.Parent;
if (parent != null)
{
if (this != parent)
{
node = parent;
}
else
{
return node;
}
}
else
{
return node;
}
}
return node;
return AncestorOrSelf(node => node.Level == 1);
}
public DynamicNode AncestorOrSelf(Func<DynamicNode, bool> func)
{

View File

@@ -89,7 +89,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(ProjectDir)bin\debug\umbraco.MacroEngines.*" "$(ProjectDir)..\presentation\bin\" /Y/F</PostBuildEvent>
<PostBuildEvent>xcopy "$(ProjectDir)bin\debug\umbraco.MacroEngines.*" "$(ProjectDir)..\umbraco\presentation\bin\" /Y/F</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.