Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Class RegexCommandInstance

    Represents a regex command instance.

    Inheritance
    System.Object
    CommandInstanceBase
    RegexCommandInstance
    Implements
    ICommandInstance
    Inherited Members
    CommandInstanceBase.Method
    CommandInstanceBase.Requirements
    CommandInstanceBase.PrefixOverride
    CommandInstanceBase.PrefixRequirementOverride
    CommandInstanceBase.CaseSensitivityOverride
    CommandInstanceBase.Timeout
    CommandInstanceBase.HandlerType
    CommandInstanceBase.Parameters
    CommandInstanceBase.GetOptionsForContext(ICommandContext)
    CommandInstanceBase.CheckMatch(ICommandContext, Int32, CommandContextOptions)
    CommandInstanceBase.InvokeCommandAsync(ParameterBuilderValues, IServiceProvider, Object, CancellationToken)
    Namespace: TehGM.Wolfringo.Commands.Initialization
    Assembly: Wolfringo.Commands.dll
    Syntax
    public class RegexCommandInstance : CommandInstanceBase, ICommandInstance

    Constructors

    | Improve this Doc View Source

    RegexCommandInstance(String, RegexOptions, TimeSpan, MethodInfo, IEnumerable<ICommandRequirement>, String, Nullable<PrefixRequirement>, Nullable<Boolean>, Int32)

    Creates a new command instance.

    Declaration
    public RegexCommandInstance(string pattern, RegexOptions regexOptions, TimeSpan regexTimeout, MethodInfo method, IEnumerable<ICommandRequirement> requirements, string prefixOverride, PrefixRequirement? prefixRequirementOverride, bool? caseSensitivityOverride, int timeout)
    Parameters
    Type Name Description
    System.String pattern

    Regex pattern that triggers this command.

    System.Text.RegularExpressions.RegexOptions regexOptions

    Regex options to build Regex with.

    System.TimeSpan regexTimeout

    Timeout for regex engine.

    System.Reflection.MethodInfo method

    Method that will be executed.

    System.Collections.Generic.IEnumerable<ICommandRequirement> requirements

    Execution requirements.

    System.String prefixOverride

    Prefix override; null for no overriding.

    System.Nullable<PrefixRequirement> prefixRequirementOverride

    Prefix requireent override; null for no overriding.

    System.Nullable<System.Boolean> caseSensitivityOverride

    Case sensitivity override; null for no overriding.

    System.Int32 timeout

    Timeout value for command execution. -1 for no timeout.

    Properties

    | Improve this Doc View Source

    Pattern

    Regex pattern that triggers this command.

    Declaration
    public string Pattern { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    CheckMatchAsync(ICommandContext, IServiceProvider, CancellationToken)

    Determines whether the command should execute.

    Declaration
    public Task<ICommandResult> CheckMatchAsync(ICommandContext context, IServiceProvider services, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    ICommandContext context

    Context of the command.

    System.IServiceProvider services

    Service provider that can be used during the checks.

    System.Threading.CancellationToken cancellationToken

    Cancellation token to cancel the checks.

    Returns
    Type Description
    System.Threading.Tasks.Task<ICommandResult>

    Result of the check.

    | Improve this Doc View Source

    ExecuteAsync(ICommandContext, IServiceProvider, ICommandResult, Object, CancellationToken)

    Executes the command.

    Declaration
    public async Task<ICommandResult> ExecuteAsync(ICommandContext context, IServiceProvider services, ICommandResult matchResult, object handler, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    ICommandContext context

    Context of the command.

    System.IServiceProvider services

    Services provider for injecting parameters into command method.

    ICommandResult matchResult

    Result of the pre-run check.

    System.Object handler

    Handler object to execute the command method in.

    System.Threading.CancellationToken cancellationToken

    Cancellation token to cancel the execution.

    Returns
    Type Description
    System.Threading.Tasks.Task<ICommandResult>

    Result of the execution.

    Implements

    ICommandInstance