OnceDisposable class¶
Attributes: [DebuggerDisplay("{DebuggerDisplay,nq}")]
Defined in
Namespace: ReactiveUI.Primitives.Disposables
Assembly: ReactiveUI.Disposables.dll
Full name: ReactiveUI.Primitives.Disposables.OnceDisposable
Modifiers: public sealed
Summary¶
A disposable holder whose inner disposable can be set exactly once.
Replaces SingleAssignmentDisposable. Subsequent assignments throw
InvalidOperationException; if the holder has been disposed before
assignment, the supplied disposable is disposed immediately and no exception is thrown.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
Class hierarchy
classDiagram
class OnceDisposable
class IsDisposed {
<>
}
IsDisposed <|.. OnceDisposable
class IDisposable {
<>
}
IDisposable <|.. OnceDisposable
Implements: IsDisposed, IDisposable
Constructors¶
| Name | Summary |
|---|---|
| .ctor |
Properties¶
| Name | Summary |
|---|---|
| IsAssigned | Gets a value indicating whether a disposable has been assigned. |
| IsDisposed | Gets a value indicating whether this instance has been disposed. |
| Disposable | Gets or sets the inner disposable. Setting more than once throws. |
Methods¶
| Name | Summary |
|---|---|
| Dispose |