Skip to content

Commit

Permalink
Attempt to resolve the "how to test `(ICollection<int>).GetGenericTyp…
Browse files Browse the repository at this point in the history
…eDefinition()`" debate
  • Loading branch information
slodge committed Jun 28, 2013
1 parent 7e40cd7 commit d31e5c9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions CrossUI/CrossUI.Core/Builder/KeyedUserInterfaceBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,10 @@ private static Type CheckListAndGetValueType(PropertyInfo propertyInfo, Type exp
{
var genericPropertyType = propertyInfo.PropertyType.GetGenericTypeDefinition();

#warning this clause commented out - would be nice to put something back in (my vote is for the original IList<T>)
// if (typeof (ICollection<int>).GetGenericTypeDefinition().IsAssignableFrom(genericPropertyType))
//if (typeof(IList<int>).GetGenericTypeDefinition().IsAssignableFrom(genericPropertyType))
// if (genericPropertyType != typeof (List<int>).GetGenericTypeDefinition())
//{
// throw new Exception("The property is not a generic IList<T>");
//}
if (genericPropertyType == null)
{
throw new Exception("The property is not a generic <T> class - this is needed for us to work out the generic type");
}

if (!typeof(IList).IsAssignableFrom(propertyInfo.PropertyType))
{
Expand Down

0 comments on commit d31e5c9

Please sign in to comment.