Created
March 10, 2010 19:04
-
-
Save kkozmic/328219 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (ComponentType.IsGenericType)// we support generic collections only | |
{ | |
// TypeUtil.GetAllInterfaces resturns flat collection of all interfaces, regardless of level | |
foreach (var @interface in TypeUtil.GetAllInterfaces(ComponentType)) | |
{ | |
if(@interface.GetGenericTypeDefinition()==typeof(IEnumerable<>)) | |
{ | |
return @interface.GetGenericArguments().Single(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment