Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

TypeImplementer: Implement multiple interfaces #42

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/TypeImplementer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ public Type GetImplementation (Type declType)

TypeBuilder typeB = modB.DefineType (proxyName, TypeAttributes.Class | TypeAttributes.Public, parentType);

string interfaceName = null;
if (declType.IsInterface)
Implement (typeB, declType, interfaceName = Mapper.GetInterfaceName (declType));
Implement (typeB, declType, Mapper.GetInterfaceName (declType));

foreach (Type iface in declType.GetInterfaces ())
Implement (typeB, iface, interfaceName == null ? Mapper.GetInterfaceName (iface) : interfaceName);
Implement (typeB, iface, Mapper.GetInterfaceName (iface));

retT = typeB.CreateType ();

Expand Down