CSharp examples for System.Reflection:Type
Returns generic argument types of the current type
// Copyright (c) Costin Morariu. All rights reserved. using System.Reflection; using System.Collections.Generic; using System;// w w w .ja v a 2s .com public class Main{ /// <summary> /// Returns generic argument types of the current type /// </summary> /// <param name="type">Current type</param> /// <returns>An array containing the types of generic arguments</returns> public static Type[] GetGenericArguments(this Type type) { return type.GetTypeInfo().GenericTypeArguments; } }