Table of Contents

Method LinkStart

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

LinkStart()

Starts the connection.

public bool LinkStart()

Returns

bool

true if the connection was started successfully; otherwise, false.

Remarks

Wrapper of MaaFramework.Binding.Interop.Native.MaaAgentClient.MaaAgentClientConnect(System.IntPtr).

LinkStart(ProcessStartInfo, CancellationToken)

Starts the agent server process using the specified System.Diagnostics.ProcessStartInfo and connects to the agent server.

To start a new process, the current MaaFramework.Binding.IMaaAgentClient.AgentServerProcess must have exited first.

The agent server process will be killed when System.IDisposable.Dispose is called.

public bool LinkStart(ProcessStartInfo info, CancellationToken cancellationToken = default)

Parameters

info ProcessStartInfo

The process start info.

cancellationToken CancellationToken

An optional token to cancel the asynchronous operation waiting for the connection.

Returns

bool

true if the connection was started successfully; otherwise, false.

Remarks

Wrapper of MaaFramework.Binding.Interop.Native.MaaAgentClient.MaaAgentClientConnect(System.IntPtr).

Exceptions

OperationCanceledException

The cancellationToken has had cancellation requested.

LinkStart(AgentServerStartupMethod, CancellationToken)

Starts the agent server process using the specified System.Diagnostics.ProcessStartInfo and connects to the agent server.

To start a new process, the current MaaFramework.Binding.IMaaAgentClient.AgentServerProcess must have exited first.

The agent server process will be killed when System.IDisposable.Dispose is called.

public bool LinkStart(IMaaAgentClient.AgentServerStartupMethod method, CancellationToken cancellationToken = default)

Parameters

method IMaaAgentClient.AgentServerStartupMethod

The delegate method that defines how to start the agent server process.

cancellationToken CancellationToken

An optional token to cancel the asynchronous operation waiting for the connection.

Returns

bool

true if the connection was started successfully; otherwise, false.

Remarks

Wrapper of MaaFramework.Binding.Interop.Native.MaaAgentClient.MaaAgentClientConnect(System.IntPtr).

Exceptions

OperationCanceledException

The cancellationToken has had cancellation requested.