Search Results for

    Show / Hide Table of Contents

    Class GenericParameterFactory

    Inheritance
    Object
    GenericParameterFactory
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Microsoft.ML.Probabilistic.Compiler.Reflection
    Assembly: Microsoft.ML.Probabilistic.Compiler.dll
    Syntax
    public static class GenericParameterFactory

    Fields

    ThisType

    Declaration
    public static readonly Type ThisType
    Field Value
    Type Description
    Type

    Methods

    ForEachTypeParameterIncludingConstraints(Type, Predicate<Type>)

    Declaration
    public static void ForEachTypeParameterIncludingConstraints(Type t, Predicate<Type> visit)
    Parameters
    Type Name Description
    Type t
    Predicate<Type> visit

    GetTypeParameterIndices(IEnumerable<Type>)

    Declaration
    public static Dictionary<Type, int> GetTypeParameterIndices(IEnumerable<Type> types)
    Parameters
    Type Name Description
    IEnumerable<Type> types
    Returns
    Type Description
    Dictionary<Type, Int32>

    IsConstructedParameter(Type)

    Declaration
    public static bool IsConstructedParameter(Type typeParam)
    Parameters
    Type Name Description
    Type typeParam
    Returns
    Type Description
    Boolean

    MakeGenericParameter(String, GenericParameterFactory.Constraints)

    Make a generic type parameter with the given constraints.

    Declaration
    public static Type MakeGenericParameter(string name, GenericParameterFactory.Constraints constraints)
    Parameters
    Type Name Description
    String name
    GenericParameterFactory.Constraints constraints
    Returns
    Type Description
    Type

    A generic type parameter.

    Remarks

    Algorithm: The type parameter is constructed by dynamically generating a type with a generic method. For example: class Parent { void method<U>() where U : IList<int> {} } If the constraints refer to other type parameters, placeholders are added to the parent type. For example: class Parent<T> { void method<U>() where U : IList<T> {} } The parent type is then specialized on the actual type parameters appearing in the constraints. The type parameter U is returned.

    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.