Table of Contents

Interface IParameterInfo

Namespace
HeyBox.Interactions
Assembly
HeyBox.Net.Interactions.dll

表示 ICommandInfo 的参数。

public interface IParameterInfo

Properties

Attributes

获取此参数的特性集合。

IReadOnlyCollection<Attribute> Attributes { get; }

Property Value

IReadOnlyCollection<Attribute>

Command

获取此参数所属的命令。

ICommandInfo Command { get; }

Property Value

ICommandInfo

DefaultValue

获取此参数的默认值(如果为可选参数)。

object? DefaultValue { get; }

Property Value

object

IsParameterArray

获取此参数是否被 params 关键字标记。

bool IsParameterArray { get; }

Property Value

bool

IsRequired

获取此参数是否为必填项。

bool IsRequired { get; }

Property Value

bool

Name

获取此参数的名称。

string Name { get; }

Property Value

string

ParameterType

获取此参数的类型。

Type ParameterType { get; }

Property Value

Type

Preconditions

获取此参数的先决条件集合。

IReadOnlyCollection<ParameterPreconditionAttribute> Preconditions { get; }

Property Value

IReadOnlyCollection<ParameterPreconditionAttribute>

Methods

CheckPreconditionsAsync(IInteractionContext, object?, IServiceProvider?)

检查执行上下文是否满足参数的先决条件要求。

Task<PreconditionResult> CheckPreconditionsAsync(IInteractionContext context, object? value, IServiceProvider? services)

Parameters

context IInteractionContext
value object
services IServiceProvider

Returns

Task<PreconditionResult>