public Task HandleAsync(ReconnectRequested message, CancellationToken cancellationToken) { if (IsConnected) { requested = true; _cancelTokenSource.Cancel(); IsConnecting = true; _SelectedServer = message.Server; } else { IsConnecting = true; _SelectedServer = message.Server; GetServerAndInitConnection(); } return(Task.CompletedTask); }
/// <summary> /// Event invocator for the <see cref="ReconnectRequested"/> event /// </summary> protected virtual void OnReconnectRequested() { ReconnectRequested?.Invoke(this, EventArgs.Empty); }