Class DownloadEndEventArgs
- Namespace
- WebDriverBiDi.BrowsingContext
- Assembly
- WebDriverBiDi.dll
Object containing event data for the browsingContext.downloadEnd event. The event data is a DownloadCompleteEventArgs when the download completed, and a DownloadCanceledEventArgs when it was canceled; only a completed download has a file path.
[JsonConverter(typeof(DiscriminatedUnionJsonConverter<DownloadEndEventArgs>))]
[DiscriminatedTypeProperty("status")]
[DiscriminatedDerivedType(typeof(DownloadCompleteEventArgs), "complete")]
[DiscriminatedDerivedType(typeof(DownloadCanceledEventArgs), "canceled")]
public abstract record DownloadEndEventArgs : NavigationEventArgs, IEquatable<WebDriverBiDiEventArgs>, IEquatable<NavigationEventArgs>, IEquatable<DownloadEndEventArgs>
- Inheritance
-
DownloadEndEventArgs
- Implements
- Derived
- Inherited Members
Constructors
DownloadEndEventArgs(DownloadEndEventArgs)
protected DownloadEndEventArgs(DownloadEndEventArgs original)
Parameters
originalDownloadEndEventArgs
Properties
DownloadId
Gets the ID for this download.
[JsonPropertyName("download")]
[JsonRequired]
[JsonInclude]
public string DownloadId { get; }
Property Value
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Status
Gets the status of the download. The status determines the type of this object: Complete for DownloadCompleteEventArgs, and Canceled for DownloadCanceledEventArgs.
[JsonPropertyName("status")]
[JsonInclude]
[JsonRequired]
public DownloadEndStatus Status { get; }
Property Value
Methods
As<T>()
Casts this DownloadEndEventArgs to a status-specific download end event args, throwing if it is not of that type. Use TryAs<T>(out T?) to test without throwing.
public T As<T>() where T : DownloadEndEventArgs
Returns
- T
This instance cast to the specified type.
Type Parameters
TThe specific type of DownloadEndEventArgs to return.
Exceptions
- WebDriverBiDiException
Thrown if this DownloadEndEventArgs is not the specified type.
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Equals(DownloadEndEventArgs?)
public virtual bool Equals(DownloadEndEventArgs? other)
Parameters
otherDownloadEndEventArgs
Returns
Equals(NavigationEventArgs?)
public override sealed bool Equals(NavigationEventArgs? other)
Parameters
otherNavigationEventArgs
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
TryAs<T>(out T?)
Attempts to cast this DownloadEndEventArgs to a status-specific download end event args, returning false rather than throwing when it is not of that type.
public bool TryAs<T>(out T? result) where T : DownloadEndEventArgs
Parameters
resultTWhen this method returns, contains the cast value or null if the cast failed.
Returns
Type Parameters
TThe specific type of DownloadEndEventArgs to return.
Operators
operator ==(DownloadEndEventArgs?, DownloadEndEventArgs?)
public static bool operator ==(DownloadEndEventArgs? left, DownloadEndEventArgs? right)
Parameters
leftDownloadEndEventArgsrightDownloadEndEventArgs
Returns
operator !=(DownloadEndEventArgs?, DownloadEndEventArgs?)
public static bool operator !=(DownloadEndEventArgs? left, DownloadEndEventArgs? right)
Parameters
leftDownloadEndEventArgsrightDownloadEndEventArgs