protected override bool ShouldReconcileItem(MemberContent member, IGraphNode targetNode, object localValue, object baseValue, bool isReference)
 {
     // Always reconcile referenced parts
     if (isReference && IsReferencedPart(member, targetNode))
     {
         return true;
     }
     return base.ShouldReconcileItem(member, targetNode, localValue, baseValue, isReference);
 }
 protected override bool ShouldVisitSourceNode(MemberContent memberContent, IGraphNode targetNode)
 {
     return (ShouldVisit?.Invoke(memberContent, targetNode) ?? true) && base.ShouldVisitSourceNode(memberContent, targetNode);
 }
 public override bool ShouldListenToTargetNode(MemberContent member, IGraphNode targetNode)
 {
     // Make sure it's actually a target (not a member) node.
     return !IsReferencedPart(member, targetNode) && base.ShouldListenToTargetNode(member, targetNode);
 }
 public virtual bool IsReferencedPart(MemberContent member, IGraphNode targetNode)
 {
     return false;
 }
 protected override bool ShouldVisitNode(MemberContent memberContent, IGraphNode targetNode)
 {
     // Make sure it's actually a target (not a member) node.
     return !propertyGraph.IsReferencedPart(memberContent, targetNode) && base.ShouldVisitNode(memberContent, targetNode);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Indicates whether a node should be visited.
 /// </summary>
 /// <param name="memberContent">The member content referencing the node to evaluate.</param>
 /// <param name="targetNode">The node to evaluate. Can be the node holding the <paramref name="memberContent"/>, or one of its target node if this node contains a reference.</param>
 /// <returns>True if the node should be visited, False otherwise.</returns>
 protected virtual bool ShouldVisitNode(MemberContent memberContent, IGraphNode targetNode)
 {
     return !visitedNodes.Contains(targetNode) && (ShouldVisit?.Invoke(memberContent, targetNode) ?? true);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Indicates whether the linker should visit the given source node.
 /// </summary>
 /// <param name="memberContent">The member content referencing the source node to evaluate.</param>
 /// <param name="targetNode">The source node to evaluate. Can be the node holding the <paramref name="memberContent"/>, or one of its target node if this node contains a reference.</param>
 /// <returns>True if the node should be visited, false otherwise.</returns>
 protected virtual bool ShouldVisitSourceNode(MemberContent memberContent, IGraphNode targetNode)
 {
     return true;
 }
Exemplo n.º 8
0
 public bool ShouldConstructMember(MemberContent content) => true;
Exemplo n.º 9
0
 public bool ShouldExpandReference(MemberContent member, ObjectReference reference) => true;
Exemplo n.º 10
0
        protected virtual bool ShouldReconcileItem(MemberContent member, IGraphNode targetNode, object localValue, object baseValue, bool isReference)
        {
            if (isReference)
            {
                // Reference type, we check matches by type
                return baseValue?.GetType() != localValue?.GetType();
            }

            // Content reference (note: they are not treated as reference
            if (AssetRegistry.IsContentType(localValue?.GetType()) || AssetRegistry.IsContentType(localValue?.GetType()))
            {
                var localRef = AttachedReferenceManager.GetAttachedReference(localValue);
                var baseRef = AttachedReferenceManager.GetAttachedReference(baseValue);
                return localRef?.Id != baseRef?.Id || localRef?.Url != baseRef?.Url;
            }
            
            // Value type, we check for equality
            return !Equals(localValue, baseValue);
        }
Exemplo n.º 11
0
 // TODO: turn protected
 public virtual bool ShouldListenToTargetNode(MemberContent member, IGraphNode targetNode)
 {
     return true;
 }