AbortSignal Class
https://dom.spec.whatwg.org/#interface-AbortSignal
public class AbortSignal : EventTarget- Inheritance
EventTargetAbortSignal
Properties
| Name | Description |
|---|---|
| Aborted | Gets a value indicating whether the signal has been aborted. |
| OnAbort | Gets or sets the event handler of the abort event. |
| Reason | Gets the reason the signal was aborted, or null when it is not aborted. |
Aborted
AbortSignal.csGets a value indicating whether the signal has been aborted.
public bool Aborted { get; }OnAbort
AbortSignal.csGets or sets the event handler of the abort event.
Reason
AbortSignal.csGets the reason the signal was aborted, or null when it is not aborted.
public object? Reason { get; }Methods
| Name | Description |
|---|---|
| Abort(object?) | https://dom.spec.whatwg.org/#dom-abortsignal-abort |
| Any(IEnumerable<AbortSignal>) | https://dom.spec.whatwg.org/#dom-abortsignal-any |
| ThrowIfAborted() | https://dom.spec.whatwg.org/#dom-abortsignal-throwifaborted |
| Timeout(GlobalScope, ulong) | https://dom.spec.whatwg.org/#dom-abortsignal-timeout: returns a signal aborted after milliseconds, measured by the timers of the event loop of window. |
| Timeout(ulong) | https://dom.spec.whatwg.org/#dom-abortsignal-timeout: the timer runs on the event loop of the current global object (the window or the worker of the running script). Without one, the signal is never aborted: use AbortSignal.Timeout. |
Abort(object?)
AbortSignal.cshttps://dom.spec.whatwg.org/#dom-abortsignal-abort
public static AbortSignal Abort(object? reason = null)Any(IEnumerable<AbortSignal>)
AbortSignal.cshttps://dom.spec.whatwg.org/#dom-abortsignal-any
public static AbortSignal Any(IEnumerable<AbortSignal> signals)ThrowIfAborted()
AbortSignal.cshttps://dom.spec.whatwg.org/#dom-abortsignal-throwifaborted
public void ThrowIfAborted()Timeout overloads
Timeout(GlobalScope, ulong)
AbortSignal.cshttps://dom.spec.whatwg.org/#dom-abortsignal-timeout: returns a signal aborted after milliseconds, measured by the timers of the event loop of window.
public static AbortSignal Timeout(GlobalScope window, ulong milliseconds)Timeout(ulong)
AbortSignal.cshttps://dom.spec.whatwg.org/#dom-abortsignal-timeout: the timer runs on the event loop of the current global object (the window or the worker of the running script). Without one, the signal is never aborted: use AbortSignal.Timeout.
public static AbortSignal Timeout(ulong milliseconds)