Types/OpenPackage.ContentTypeMap/set_TypeMap.ps1

<#
.SYNOPSIS
    Sets the TypeMap
.DESCRIPTION
    Sets the TypeMap.
    
    If an empty dictionary is provided, will clear the typemap.

    Any other values provided will override the existing content type map.
#>

param(
[Collections.IDictionary]
$TypeMap
)

$thisTypeMap = $this.TypeMap

if ($TypeMap.Count -eq 0) {
    $thisTypeMap.Clear()
} else {
    foreach ($key in $TypeMap.Keys) {
        $thisTypeMap[$key] = $TypeMap[$key]
    }
}