Table of Contents

Method PressPropertyButtonAsync

Namespace
OBSStudioClient.Model
Assembly
OBSClient.dll

PressPropertyButtonAsync(string, CancellationToken)

Presses a button of the properties of the input, as a person does in the properties window, and returns when OBS Studio has answered.

public Task PressPropertyButtonAsync(string propertyName, CancellationToken cancellationToken = default)

Parameters

propertyName string

The name of the button: refreshnocache is the button that reloads a browser source (the name of the button is not the text on it).

cancellationToken CancellationToken

A token that ends the wait. A change that was not sent yet is not sent.

Returns

Task

A task that completes when OBS Studio has answered. What the button does may take longer.

Remarks

What a button does depends on the input: the model shows what it changes through the events, like any other change, and the call does not wait for that. See SetEnabledAsync(bool, CancellationToken) for the order of changes.

Exceptions

ArgumentException

propertyName is empty.

ObsRemovedException

The input was destroyed.

ObsNotConnectedException

There is no connection to OBS Studio. Nothing was changed.

ObsNotReadyException

OBS Studio is changing its scene collection, or did so after the call. Nothing was changed.

ObsUnknownOutcomeException

OBS Studio did not answer in time, or the connection ended: it is not known whether it pressed the button.

ObsResponseException

OBS Studio refused the request: the input has no property with that name (ErrorCode is ResourceNotFound), it is not a button (InvalidResourceType), or the button is not enabled (InvalidResourceState).