03-04-14, 04:45 PM
كود :
' The class FileDownloadCompletedEventArgs defines the arguments used by
' the FileDownloadCompleted event of FileDownloader.
Imports System.IO
Public Class FileDownloadCompletedEventArgs
Inherits EventArgs
Private _downloadedSize As Int64
Private _totalSize As Int64
Private _error As Exception
Private _totalTime As TimeSpan
Private _downloadedFile As FileInfo
Public Sub New(ByVal downloadedFile As FileInfo, ByVal downloadedSize As Int64, ByVal totalSize As Int64, ByVal totalTime As TimeSpan, ByVal ex As Exception)
Me.DownloadedFile = downloadedFile
Me.DownloadedSize = downloadedSize
Me.TotalSize = totalSize
Me.TotalTime = totalTime
Me.Error = ex
End Sub
Public Property DownloadedSize() As Int64
Get
Return _downloadedSize
End Get
Private Set(ByVal value As Int64)
_downloadedSize = value
End Set
End Property
Public Property TotalSize() As Int64
Get
Return _totalSize
End Get
Private Set(ByVal value As Int64)
_totalSize = value
End Set
End Property
Public Property [Error]() As Exception
Get
Return _error
End Get
Private Set(ByVal value As Exception)
_error = value
End Set
End Property
Public Property TotalTime() As TimeSpan
Get
Return _totalTime
End Get
Private Set(ByVal value As TimeSpan)
_totalTime = value
End Set
End Property
Public Property DownloadedFile() As FileInfo
Get
Return _downloadedFile
End Get
Private Set(ByVal value As FileInfo)
_downloadedFile = value
End Set
End Property
End Class
