protected override void ProcessIdentifiableMembers(IIdentifiable identifiable, IMemberNode member) { if (propertyGraphDefinition.IsMemberTargetObjectReference(member, identifiable)) { externalReferences.Add(identifiable); if (!externalReferenceAccessors.TryGetValue(identifiable, out var accessors)) { externalReferenceAccessors.Add(identifiable, accessors = new List <NodeAccessor>()); } accessors.Add(CurrentPath.GetAccessor()); } else { internalReferences.Add(identifiable); } }
/// <inheritdoc/> protected override void VisitMemberNode([NotNull] IAssetMemberNode memberNode, int inNonIdentifiableType) { var value = memberNode.Retrieve(); if (propertyGraphDefinition.IsMemberTargetObjectReference(memberNode, value)) { if (value == null) { return; } var identifiable = value as IIdentifiable; if (identifiable == null) { throw new InvalidOperationException("IsObjectReference returned true for an object that is not IIdentifiable"); } var id = identifiable.Id; if (ShouldOutputReference?.Invoke(id) ?? true) { Result.Set(ConvertPath(CurrentPath, inNonIdentifiableType), id); } } }
/// <inheritdoc/> protected override bool ShouldVisitMemberTarget(IMemberNode member) { return(base.ShouldVisitMemberTarget(member) && !PropertyGraphDefinition.IsMemberTargetObjectReference(member, member.Retrieve())); }