IKVM.Reflection.Type.GetGenericArguments C# (CSharp) Метод

GetGenericArguments() публичный Метод

public GetGenericArguments ( ) : Type[]
Результат Type[]
        public virtual Type[] GetGenericArguments()
        {
            return Type.EmptyTypes;
        }

Usage Example

Пример #1
0
        private static void TestEnumerableListPatterns(TypeModel model, BasicList candidates, Type iType)
        {
#if WINRT
            TypeInfo iTypeInfo = iType.GetTypeInfo();
            if (iTypeInfo.IsGenericType)
            {
                Type typeDef = iTypeInfo.GetGenericTypeDefinition();
                if (typeDef == typeof(System.Collections.Generic.ICollection <>) || typeDef.GetTypeInfo().FullName == "System.Collections.Concurrent.IProducerConsumerCollection`1")
                {
                    Type[] iTypeArgs = iTypeInfo.GenericTypeArguments;
                    if (!candidates.Contains(iTypeArgs[0]))
                    {
                        candidates.Add(iTypeArgs[0]);
                    }
                }
            }
#elif !NO_GENERICS
            if (iType.IsGenericType)
            {
                Type typeDef = iType.GetGenericTypeDefinition();
                if (typeDef == model.MapType(typeof(System.Collections.Generic.IEnumerable <>)) ||
                    typeDef == model.MapType(typeof(System.Collections.Generic.ICollection <>)) ||
                    typeDef.FullName == "System.Collections.Concurrent.IProducerConsumerCollection`1")
                {
                    Type[] iTypeArgs = iType.GetGenericArguments();
                    if (!candidates.Contains(iTypeArgs[0]))
                    {
                        candidates.Add(iTypeArgs[0]);
                    }
                }
            }
#endif
        }
All Usage Examples Of IKVM.Reflection.Type::GetGenericArguments