Skip to content

Class ClassDispatcher<T>

Namespace: Tool.Utils.ActionDelegate
Assembly: Tool.Net.dll

根据 ConstructorInfo 对象,创建一个委托,实现类调用,提高性能,支持各种返回值

csharp
public class ClassDispatcher<T>

Type Parameters

T

返回任何类型

Inheritance

objectClassDispatcher<T>

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Extension Methods

ObjectExtension.Add<T>(object, object, object), ObjectExtension.CopyEntity(object, object, params string[]), ObjectExtension.EntityToJson(object), ObjectExtension.EntityToJson(object, bool), ObjectExtension.EntityToJson(object, bool, string), DictionaryExtension.GetDictionary(object), TypeExtension.GetFieldKey(object, string, out bool), TypeExtension.GetFieldKey<T>(object, string, out bool), TypeExtension.GetFieldKey(object, Type, string, out bool), ObjectExtension.GetIntPtr(object), ObjectExtension.GetIntPtrInt(object), TypeExtension.GetPropertieFind(object, string, bool), TypeExtension.GetProperties(object), TypeExtension.GetPropertyKey(object, string, out bool), TypeExtension.GetPropertyKey<T>(object, string, out bool), TypeExtension.GetPropertyKey(object, Type, string, out bool), TypeExtension.GetValue(object, PropertyDescriptor), TypeExtension.GetValue(object, string, bool), TypeExtension.GetValue(object, string), ObjectExtension.Read<T>(object, object, int, int), ObjectExtension.Read<T>(object, int, object, int, int), DictionaryExtension.SetDictionary(object, IDictionary<string, object>), TypeExtension.SetFieldKey(object, string, object), TypeExtension.SetFieldKey<T>(object, string, object), TypeExtension.SetFieldKey(object, Type, string, object), TypeExtension.SetPropertyKey(object, string, object), TypeExtension.SetPropertyKey<T>(object, string, object), TypeExtension.SetPropertyKey(object, Type, string, object), TypeExtension.SetValue(object, PropertyDescriptor, object), TypeExtension.SetValue(object, string, object, bool), TypeExtension.SetValue(object, string, object), ObjectExtension.ToBase64String(object), ObjectExtension.ToBytes(object), ObjectExtension.ToBytes(object, out Type), DictionaryExtension.ToDictionary(object), DictionaryExtension.ToDictionary<T>(object), DictionaryExtension.ToIDictionary(object), DictionaryExtension.ToIDictionary<T>(object), ObjectExtension.ToJson(object), ObjectExtension.ToJson(object, JsonSerializerOptions), ObjectExtension.ToJsonWeb(object), ObjectExtension.ToJsonWeb(object, Action<JsonSerializerOptions>), ObjectExtension.ToTryVar<T>(object, T), ObjectExtension.ToVar<T>(object), ObjectExtension.ToVar(object, Type, bool), ObjectExtension.ToVar(object, string), ObjectExtension.ToXml(object)

Remarks

代码由逆血提供支持

Constructors

ClassDispatcher()

根据构造函数,创建对象委托

csharp
public ClassDispatcher()

ClassDispatcher(ConstructorInfo)

根据构造函数,创建对象委托

csharp
public ClassDispatcher(ConstructorInfo constructor)

Parameters

constructor ConstructorInfo

构造函数对象

ClassDispatcher(Type)

根据构造函数,创建对象委托

csharp
public ClassDispatcher(Type classtype)

Parameters

classtype Type

对象类型

Properties

Parameters

方法参数

csharp
public Parameter[] Parameters { get; }

Property Value

Parameter[]

Type

实例化对象类型

csharp
public Type Type { get; }

Property Value

Type

Methods

GetClass(ConstructorInfo)

通过构造器,直接获取相关构造委托

csharp
public static NewClass<T> GetClass(ConstructorInfo constructor)

Parameters

constructor ConstructorInfo

构造器

Returns

NewClass<T>

构造委托

Invoke(params object[])

创建 New 对象

csharp
public T Invoke(params object[] parameters)

Parameters

parameters object[]

参数

Returns

T

返回 New 新对象

基于Apache-2.0协议开源