Show / Hide Table of Contents

Class OptimizedActivator

https://rogerjohansson.blog/2008/02/28/linq-expressions-creating-objects/ https://stackoverflow.com/a/16162475 https://stackoverflow.com/questions/13041674/create-func-or-action-for-any-method-using-reflection-in-c Check above links for details.

Inheritance
System.Object
OptimizedActivator
Namespace: Eco.Core.Utils
Assembly: Eco.Core.dll
Syntax
public static class OptimizedActivator : Object

Methods

BuildDelegate<T>(MethodInfo, Object[])

Builds compiled delegate of type T (much faster than reflection) for call to method. If T has less arguments than method then missingParamValues will be used or default values supplied.

Declaration
public static T BuildDelegate<T>(this MethodInfo method, params object[] missingParamValues)
    where T : Delegate
Parameters
Type Name Description
System.Reflection.MethodInfo method
System.Object[] missingParamValues
Returns
Type Description
T
Type Parameters
Name Description
T

GetActivator<T>(ConstructorInfo)

Declaration
public static OptimizedActivator.ActivatorDelegate<T> GetActivator<T>(ConstructorInfo ctor)
Parameters
Type Name Description
System.Reflection.ConstructorInfo ctor
Returns
Type Description
OptimizedActivator.ActivatorDelegate<T>
Type Parameters
Name Description
T

GetDefaultActivator<T>()

Declaration
public static OptimizedActivator.ActivatorDelegate<T> GetDefaultActivator<T>()
Returns
Type Description
OptimizedActivator.ActivatorDelegate<T>
Type Parameters
Name Description
T
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾