src/Microsoft/JSInterop/0.Core/src/Utils/TypeUtils.cs
/// <summary>
/// Gets all the interfaces implemented or inherited.
/// </summary>
Gets all the interfaces implemented or inherited.
Gets all the interfaces implemented or inherited .
public static HashSet<Type> GetInterfaces(params Type[] types)
        {
            var interfaceTypeSet = new HashSet<Type>();
            if (types == null) {
                return interfaceTypeSet;
            }
            for (var index = 0; index < types.Length; index++) {
                var currentType = types[index];
                if (currentType == null) {
                    continue;
                }
                if (currentType.IsInterface) {
                    if (interfaceTypeSet.Add(currentType) == false) {
                        continue;
                    }
                }
                var currentTypeTheirInterfaceTypes = currentType.GetInterfaces();
                for (var i = 0; i < currentTypeTheirInterfaceTypes.Length; i++) {
                    var interfaceType = currentTypeTheirInterfaceTypes[i];
                    interfaceTypeSet.Add(interfaceType);
                }
            }
            return interfaceTypeSet;
        }
public static HashSet < Type > GetInterfaces ( params Type [ ] types ) { var interfaceTypeSet = new HashSet < Type > ( ) ; if ( types == null ) { return interfaceTypeSet ; } for ( var index = 0 ; index < types . Length ; index ++ ) { var currentType = types [ index ] ; if ( currentType == null ) { continue ; } if ( currentType . IsInterface ) { if ( interfaceTypeSet . Add ( currentType ) == false ) { continue ; } } var currentTypeTheirInterfaceTypes = currentType . GetInterfaces ( ) ; for ( var i = 0 ; i < currentTypeTheirInterfaceTypes . Length ; i ++ ) { var interfaceType = currentTypeTheirInterfaceTypes [ i ] ; interfaceTypeSet . Add ( interfaceType ) ; } } return interfaceTypeSet ; }
Gets all the interfaces implemented or inherited.
Gets all the interfaces implemented or inherited .