Method RemoveAsync
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
RemoveAsync(string, CancellationToken)
Removes a profile, and returns when the model no longer lists it.
public Task RemoveAsync(string name, CancellationToken cancellationToken = default)
Parameters
namestringThe name of the profile. It can not be the current profile: make another profile the current one first (SetCurrentAsync(string, CancellationToken)).
cancellationTokenCancellationTokenA token that ends the wait. A change that was not sent yet is not sent.
Returns
Remarks
OBS Studio deletes the profile, with its settings and files; that can not be undone. For the current profile it does not: it opens a question in its own window ("are you sure?") and answers at once that it removed it (measured with OBS Studio 33.0.0, and read in its source); the profile stays until somebody answers the question. The call refuses it, before anything is sent, so that no question is left on the screen of the user.
See SetEnabledAsync(bool, CancellationToken) for the order of changes and the wait.
Exceptions
- ArgumentException
nameis empty.- InvalidOperationException
The profile is the current one (also when it is the only one). Nothing was sent.
- ObsNotFoundException
OBS Studio has no profile of that name (the message suggests names that are close). Nothing was changed.
- 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 removed the profile.
- ObsNotConfirmedException
OBS Studio said that it removed the profile, and the model still lists it. Do not send the change again.
- ObsResponseException
OBS Studio refused the change.