語言

JsonRpcRequest.TryGetTypedArguments 方法

定義

取得參數以供方法調用,並強制使用能滿足指定參數列表的型別。

public virtual StreamJsonRpc.Protocol.JsonRpcRequest.ArgumentMatchResult TryGetTypedArguments(ReadOnlySpan<System.Reflection.ParameterInfo> parameters, Span<object> typedArguments);
public virtual StreamJsonRpc.Protocol.JsonRpcRequest.ArgumentMatchResult TryGetTypedArguments(ReadOnlySpan<System.Reflection.ParameterInfo> parameters, Span<object?> typedArguments);
abstract member TryGetTypedArguments : ReadOnlySpan<System.Reflection.ParameterInfo> * Span<obj> -> StreamJsonRpc.Protocol.JsonRpcRequest.ArgumentMatchResult
override this.TryGetTypedArguments : ReadOnlySpan<System.Reflection.ParameterInfo> * Span<obj> -> StreamJsonRpc.Protocol.JsonRpcRequest.ArgumentMatchResult
Public Overridable Function TryGetTypedArguments (parameters As ReadOnlySpan(Of ParameterInfo), typedArguments As Span(Of Object)) As JsonRpcRequest.ArgumentMatchResult

參數

parameters
ReadOnlySpan<ParameterInfo>

參數必須滿足的參數列表。

typedArguments
Span<Object>

一個陣列,用能滿足每個 parametersCLR 類型需求的參數初始化。 此跨度長度必須等於 的 parameters長度。

傳回

true 如果所有參數都能符合 的類型 parameters ,且 typedArguments 被初始化; false 否則。

例外狀況

當參數存在但無法反序列化時,會拋出。

適用於