IKVM.Reflection.Type.GetInterfaces C# (CSharp) Method

GetInterfaces() public method

public GetInterfaces ( ) : Type[]
return Type[]
        public Type[] GetInterfaces()
        {
            List<Type> list = new List<Type>();
            for (Type type = this; type != null; type = type.BaseType)
            {
                AddInterfaces(list, type);
            }
            return list.ToArray();
        }

Usage Example

Example #1
0
        static Type ResolveIReadOnlyCollection(Type declaredType, Type t)
        {
#if WINRT
            if (CheckIsIReadOnlyCollectionExactly(declaredType.GetTypeInfo()))
            {
                return(declaredType);
            }
            foreach (Type intImplBasic in declaredType.GetTypeInfo().ImplementedInterfaces)
            {
                TypeInfo intImpl = intImplBasic.GetTypeInfo();
                if (CheckIsIReadOnlyCollectionExactly(intImpl))
                {
                    return(intImplBasic);
                }
            }
#else
            if (CheckIsIReadOnlyCollectionExactly(declaredType))
            {
                return(declaredType);
            }
            foreach (Type intImpl in declaredType.GetInterfaces())
            {
                if (CheckIsIReadOnlyCollectionExactly(intImpl))
                {
                    return(intImpl);
                }
            }
#endif
            return(null);
        }
All Usage Examples Of IKVM.Reflection.Type::GetInterfaces