Method GetPropertyItemsAsync
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
GetPropertyItemsAsync(string, CancellationToken)
Asks OBS Studio for the choices of a list property of the input: what the dropdown with that name in the properties window of the input holds.
public Task<IReadOnlyList<ObsPropertyItem>> GetPropertyItemsAsync(string propertyName, CancellationToken cancellationToken = default)
Parameters
propertyNamestringThe name of the property: the name of the setting that the dropdown sets (
device_idof a video capture device,monitor_idof a display capture).cancellationTokenCancellationTokenA token that ends the wait. A request that was not sent yet is not sent.
Returns
- Task<IReadOnlyList<ObsPropertyItem>>
The choices, in the order of the dropdown. It is empty when the list is.
Remarks
The list is what OBS Studio makes when it is asked: the displays and the devices that the computer has at that moment. Use it when a kind offers a choice that the settings can not tell: the value of a choice (Value) is what to set the setting to (see SetSettingsAsync(object, bool, CancellationToken)). The request is made in its turn, after the changes that were asked for before it.
Exceptions
- ArgumentException
propertyNameis empty.- ObsRemovedException
The input was destroyed.
- ObsNotConnectedException
There is no connection to OBS Studio.
- ObsNotReadyException
OBS Studio is changing its scene collection, or did so after the call.
- TimeoutException
OBS Studio did not answer in time (WriteTimeout).
- ObsResponseException
OBS Studio refused the request: the input has no property with that name (ErrorCode is ResourceNotFound), or it is not a list (InvalidResourceType).