TimerHandler Struct
The handler of GlobalScope.SetTimeout and GlobalScope.SetInterval (https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timerhandler): a callback, or the source text of a script (a string or a TrustedScript), which only runs when the browsing context has a script engine.
public readonly struct TimerHandler : IEquatable<TimerHandler>- Implements
Properties
| Name | Description |
|---|---|
| Value | Gets the value: a FunctionCallback, an Action, a String or a TrustedScript. |
Gets the value: a FunctionCallback, an Action, a String or a TrustedScript.
public object Value { get; }Property value
Methods
| Name | Description |
|---|---|
| Equals(TimerHandler) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| FromAction(Action) | Creates a timer handler from a .NET delegate. |
| FromFunction(FunctionCallback) | Creates a timer handler from a callback function. |
| FromString(string) | Creates a timer handler from the source text of a script. |
| FromTrustedScript(TrustedScript) | Creates a timer handler from a trusted script. |
| GetHashCode() | Returns the hash code for this instance. |
| ToString() | Returns the fully qualified type name of this instance. |
Equals overloads
Equals(TimerHandler)
GlobalScope.Timers.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(TimerHandler other)Parameters
otherTimerHandler- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
GlobalScope.Timers.csFromAction(Action)
GlobalScope.Timers.csCreates a timer handler from a .NET delegate.
public static TimerHandler FromAction(Action value)FromFunction(FunctionCallback)
GlobalScope.Timers.csCreates a timer handler from a callback function.
public static TimerHandler FromFunction(FunctionCallback value)FromString(string)
GlobalScope.Timers.csCreates a timer handler from the source text of a script.
public static TimerHandler FromString(string value)FromTrustedScript(TrustedScript)
GlobalScope.Timers.csCreates a timer handler from a trusted script.
public static TimerHandler FromTrustedScript(TrustedScript value)GetHashCode()
GlobalScope.Timers.csToString()
GlobalScope.Timers.csOperators
| Name | Description |
|---|---|
| operator ==(TimerHandler, TimerHandler) | Returns whether the two timer handlers hold equal values. |
| implicit operator TimerHandler(FunctionCallback) | Converts a callback function to a timer handler. |
| implicit operator TimerHandler(TrustedScript) | Converts a trusted script to a timer handler. |
| implicit operator TimerHandler(Action) | Converts a .NET delegate to a timer handler. |
| implicit operator TimerHandler(string) | Converts the source text of a script to a timer handler. |
| operator !=(TimerHandler, TimerHandler) | Returns whether the two timer handlers hold different values. |
operator ==(TimerHandler, TimerHandler)
GlobalScope.Timers.csReturns whether the two timer handlers hold equal values.
public static bool operator ==(TimerHandler left, TimerHandler right)op_Implicit overloads
implicit operator TimerHandler(FunctionCallback)
GlobalScope.Timers.csConverts a callback function to a timer handler.
public static implicit operator TimerHandler(FunctionCallback value)implicit operator TimerHandler(TrustedScript)
GlobalScope.Timers.csConverts a trusted script to a timer handler.
public static implicit operator TimerHandler(TrustedScript value)implicit operator TimerHandler(Action)
GlobalScope.Timers.csConverts a .NET delegate to a timer handler.
public static implicit operator TimerHandler(Action value)implicit operator TimerHandler(string)
GlobalScope.Timers.csConverts the source text of a script to a timer handler.
public static implicit operator TimerHandler(string value)operator !=(TimerHandler, TimerHandler)
GlobalScope.Timers.csReturns whether the two timer handlers hold different values.
public static bool operator !=(TimerHandler left, TimerHandler right)