Fixed null reference problems with new dynamicbackingitem

Fixed recursive property null reference problems
Fixed issue with node having no children and property check crashing
Made DynamicXml behave more consistently based on user feedback
Added IsNull and HasValue to PropertyResult (comes back from GetProperty but you may need to cast it)
Added new Model.IsNull(string alias, bool recursive) and Model.HasValue(string alias, bool recursive) and Model.IsNull(string alias) and Model.HasValue(string alias)
This commit is contained in:
agrath@gmail.com
2011-06-12 11:21:44 -02:00
parent c6dd41c36a
commit b367f63c1d
5 changed files with 78 additions and 42 deletions

View File

@@ -2,16 +2,21 @@
using umbraco.cms.businesslogic.macro;
using umbraco.interfaces;
namespace umbraco.MacroEngines {
namespace umbraco.MacroEngines
{
public abstract class DynamicNodeContext : BaseContext<DynamicNode> {
public abstract class DynamicNodeContext : BaseContext<DynamicNode>
{
public override void SetMembers(MacroModel macro, INode node) {
public override void SetMembers(MacroModel macro, INode node)
{
if (macro == null)
throw new ArgumentNullException("macro");
if (node == null)
throw new ArgumentNullException("node");
CurrentModel = new DynamicNode(node);
var backingItem = new DynamicBackingItem(node);
var dynamicNode = new DynamicNode(backingItem);
CurrentModel = dynamicNode;
base.SetMembers(macro, node);
}