Table of Contents

Method Register<T>

Namespace
MaaFramework.Binding
Assembly
MaaFramework.Binding.Native.dll

Register<T>(string, T)

Registers a MaaFramework.Binding.Custom.IMaaCustomAction or MaaFramework.Binding.Custom.IMaaCustomRecognition in the MaaFramework.Binding.IMaaAgentServer.

public MaaAgentServer Register<T>(string name, T custom) where T : IMaaCustomResource

Parameters

name string

The new name that will be used to reference the custom resource.

custom T

The custom resource instance to register.

Returns

MaaAgentServer

Type Parameters

T

The MaaFramework.Binding.Custom.IMaaCustomAction or MaaFramework.Binding.Custom.IMaaCustomRecognition.

Exceptions

MaaInteroperationException

Thrown if the registration fails.

Register<T>(string?)

public MaaAgentServer Register<T>(string? name = null) where T : IMaaCustomResource, new()

Parameters

name string?

Returns

MaaAgentServer

Type Parameters

T

Register<T>(T)

Registers a MaaFramework.Binding.Custom.IMaaCustomAction or MaaFramework.Binding.Custom.IMaaCustomRecognition in the MaaFramework.Binding.IMaaAgentServer.

public MaaAgentServer Register<T>(T custom) where T : IMaaCustomResource

Parameters

custom T

The custom resource instance to register.

Returns

MaaAgentServer

Type Parameters

T

The MaaFramework.Binding.Custom.IMaaCustomAction or MaaFramework.Binding.Custom.IMaaCustomRecognition.

Remarks

Wrapper of MaaFramework.Binding.Interop.Native.MaaAgentServer.MaaAgentServerRegisterCustomAction(System.String,MaaFramework.Binding.Interop.Native.MaaCustomActionCallback,System.IntPtr) and MaaFramework.Binding.Interop.Native.MaaAgentServer.MaaAgentServerRegisterCustomRecognition(System.String,MaaFramework.Binding.Interop.Native.MaaCustomRecognitionCallback,System.IntPtr).

Exceptions

MaaInteroperationException

Thrown if the registration fails.