public override void VisitTypeNode(TypeNode typeNode) { if (typeNode == null) { return; } // we might have copied this type already if (this.duplicatedMembers[typeNode.UniqueKey] != null) { return; } TypeNode targetType = typeNode.FindShadow(this.targetAssembly); if (targetType != null) { if (targetType.Contract == null) { targetType.Contract = new TypeContract(targetType, true); } this.outOfBandDuplicator.TargetType = targetType; if (typeNode.Contract != null) { InvariantList duplicatedInvariants = this.outOfBandDuplicator.VisitInvariantList(typeNode.Contract.Invariants); targetType.Contract.Invariants = duplicatedInvariants; } CopyAttributesWithoutDuplicateUnlessAllowMultiple(targetType, typeNode); base.VisitTypeNode(typeNode); } else { // target type does not exist. Copy it if (typeNode.DeclaringType != null) { // nested types are members and have been handled by CopyMissingMembers } else { this.outOfBandDuplicator.VisitTypeNode(typeNode); } } }