一款简单易用的基础网络通讯组件库。

Method 类

一个动态调用方法

Definition

命名空间: TouchSocket.Core
程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:3.0.0+ccaf96084d09f972257496d1dd63b8ba3c1e44f0
C#
public class Method
Inheritance
Object    Method
Derived

构造函数

Method 初始化一个动态调用方法

属性

DynamicBuilderType 获取调用器的构建类型。
HasReturn 是否具有返回值。当返回值为Task时,也会认为没有返回值。
Info 方法信息
Name 获取方法名
ReturnType 返回值类型。

当方法为void或task时,为null

当方法为task泛型时,为泛型元素类型

TaskType 返回值的Task类型。

方法

CreateExpressionInvoker 构建表达式树调用
CreateILInvoker 构建IL调用
EqualsDetermines whether the specified object is equal to the current object.
(继承自 Object。)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object。)
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
Invoke 执行方法。
InvokeAsync(Object, Object) 异步执行方法。
InvokeAsyncTResult(Object, Object) 调用异步结果
InvokeObjectAsync 执行方法。

当方法为void或task时,会异常

当方法为task泛型时,会await后的值

支持调用方为UI主线程。

MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
ToStringReturns a string that represents the current object.
(继承自 Object。)

扩展方法

Map
(由 Mapper 定义。)
Map
(由 Mapper 定义。)
MapTTarget
(由 Mapper 定义。)
ToJsonString 转换为Json
(由 SerializeConvert 定义。)

参见