03-04-14, 04:35 PM
كود :
' This interface defines the basic properties and methods of a Downloader.
Imports System.Net
Public Interface IFileDownloader
#Region " Property "
' Basic settings of a Downloader
Property Url() As Uri
Property DownloadPath() As String
Property TotalSize() As Long
Property Credentials() As ICredentials
Property Proxy() As IWebProxy
' Support the ""Pause"", ""Resume"" and Multi-Threads feature.
Property IsRangeSupported() As Boolean
Property StartPoint() As Long
Property EndPoint() As Long
' The downloaded data and status.
Property DownloadedSize() As Long
Property CachedSize() As Integer
Property HasChecked() As Boolean
Property Status() As FileDownloadStatus
ReadOnly Property TotalUsedTime() As TimeSpan
' Advanced settings of a Downloader
Property BufferSize() As Integer
Property BufferCountPerNotification() As Integer
Property MaxCacheSize() As Integer
#End Region
#Region " Methods "
Sub CheckUrl(<System.Runtime.InteropServices.Out()> ByRef fileName As String)
Sub BeginDownload()
Sub Download()
Sub Pause()
Sub [Resume]()
Sub BeginResume()
Sub Cancel()
#End Region
#Region " Events "
Event DownloadCompleted As EventHandler(Of FileDownloadCompletedEventArgs)
Event DownloadProgressChanged As EventHandler(Of FileDownloadProgressChangedEventArgs)
Event StatusChanged As EventHandler
#End Region
End Interface
