Class CompanionConnector
- Namespace
- XeroxDev.YTMDesktop.Companion
- Assembly
- XeroxDev.YTMDesktop.Companion.dll
Companion Connector. This class is the main class of the library. It contains the rest and socket client.
You can also use the RestClient and SocketClient directly if you want to. But you have to manage the settings update for both clients yourself.
public class CompanionConnector
- Inheritance
-
CompanionConnector
- Inherited Members
Constructors
CompanionConnector(ConnectorSettings)
The companion connector. This class is the main class of the library. It contains the rest and socket client.
public CompanionConnector(ConnectorSettings settings)
Parameters
settings
ConnectorSettingsThe settings for the rest and socket clients.
Properties
RestClient
The rest client to make requests to the server.
public RestClient RestClient { get; }
Property Value
Settings
Gets or sets the settings for the rest and socket clients.
public ConnectorSettings Settings { get; set; }
Property Value
SocketClient
The socket client to make requests to the server.
public SocketClient SocketClient { get; }
Property Value
Methods
SetAuthToken(string)
Set the authentication token, so it can be used for further requests.
This automatically sets the token for both clients and reconnects the socket client if the token changed.
public void SetAuthToken(string token)
Parameters
token
stringThe token to set
SetSettings(ConnectorSettings)
Set the settings for the rest and socket clients.
public void SetSettings(ConnectorSettings settings)
Parameters
settings
ConnectorSettingsThe settings to set