Otter SDK Reference
Version:

SlimActivator Class

Slimmed down version of System.Activator.

Inheritance Hierarchy

  • object
    • Inedo.SlimActivator

Syntax

public class SlimActivator

Methods

Name Description
CreateInstance(System.Type type)

Returns a new instance of the specified type.

CreateInstance<T>

Returns a new instance of the type <typeparamref name="T" />.

CreateInstance(System.Type type, bool allowNonPublicConstructor)

Returns a new instance of the specified type.

CreateInstance<T>(bool allowNonPublicConstructor)

Returns a new instance of the type <typeparamref name="T" />.

GetFactory(System.Type type)

Returns a factory method that can be used to create an instance of the specified type.

GetFactory(System.Type type, bool allowNonPublicConstructor)

Returns a factory method that can be used to create an instance of the specified type.

GetFactory<T>

Returns a factory method that can be used to create an instance of the type <typeparamref name="T" />.

GetFactory<T>(bool allowNonPublicConstructor)

Returns a factory method that can be used to create an instance of the type <typeparamref name="T" />.

Remarks

This maintains an internal cache of instance creator factories, and is more suited for creating many instances of the same types where performance is critical and System.Activator.CreateInstance(System.Type) adds too much overhead.