Show / Hide Table of Contents

    Class Activator

    Contains methods to create types of objects locally. This class cannot be inherited.

    Inheritance
    Object
    Activator
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: System
    Assembly: nanoFramework.DependencyInjection.dll
    Syntax
    public static class Activator

    Methods

    | Improve this Doc View Source

    CreateInstance(String)

    Creates an instance of the type whose name is specified, using the named assembly.

    Declaration
    public static object CreateInstance(string typename)
    Parameters
    Type Name Description
    String typename

    The fully qualified name of the type to create an instance of.

    Returns
    Type Description
    Object
    | Improve this Doc View Source

    CreateInstance(Type)

    Creates an instance of the specified type using that type's parameterless constructor.

    Declaration
    public static object CreateInstance(Type type)
    Parameters
    Type Name Description
    Type type

    The type of object to create.

    Returns
    Type Description
    Object
    | Improve this Doc View Source

    CreateInstance(Type, Object[])

    Creates an instance of the specified type using the constructor that best matches the specified parameters.

    Declaration
    public static object CreateInstance(Type type, params object[] args)
    Parameters
    Type Name Description
    Type type

    The type of object to create.

    Object[] args

    An array of arguments that match in number, order, and type the parameters of the constructor to invoke. If args is an empty array or null, the constructor that takes no parameters (the parameterless constructor) is invoked.

    Returns
    Type Description
    Object
    | Improve this Doc View Source

    CreateInstance(Type, Type[], Object[])

    Creates an instance of the specified type using the constructor that best matches the specified parameters.

    Declaration
    public static object CreateInstance(Type type, Type[] types, params object[] args)
    Parameters
    Type Name Description
    Type type

    The type of object to create.

    Type[] types

    An array of Type objects representing the number, order, and type of the parameters for the desired constructor. If types is an empty array or null, to get constructor that takes no parameters.

    Object[] args

    An array of arguments that match in number, order, and type the parameters of the constructor to invoke. If args is an empty array or null, the constructor that takes no parameters (the parameterless constructor) is invoked.

    Returns
    Type Description
    Object
    Exceptions
    Type Condition
    ArgumentNullException

    type can't be null.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2018 nanoFramework Contributors
    Generated by DocFX