public void MergeTypesByShape()
{
foreach (var typeDescriptor in _temporaryMap)
{
var d = typeDescriptor.Value;
foreach (var existingTypeDescriptor in _type2DescriptorMap)
{
if (d.Equals(existingTypeDescriptor.Value))
{
_remap[d] = existingTypeDescriptor.Value;
break;
}
}
}
foreach (var typeDescriptor in _temporaryMap)
{
var d = typeDescriptor.Value;
d.MapNestedTypes(desc =>
{
ITypeDescriptor res;
if (_remap.TryGetValue(desc, out res)) return res;
return desc;
});
}
}