markus / MarkusAutoUpdate / src / NetSparkle / Interfaces / IUpdateDownloader.cs @ d8f5045e
이력 | 보기 | 이력해설 | 다운로드 (2.39 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.ComponentModel; |
4 |
using System.Net; |
5 |
using System.Text; |
6 |
using System.Threading.Tasks; |
7 |
|
8 |
namespace NetSparkleUpdater.Interfaces |
9 |
{ |
10 |
/// <summary> |
11 |
/// Interface for objects that can download (or otherwise obtain) update files |
12 |
/// for a given <see cref="AppCastItem"/>. These objects should send back |
13 |
/// progress updates and handle other excepctions or other event changes as necessary. |
14 |
/// </summary> |
15 |
public interface IUpdateDownloader |
16 |
{ |
17 |
/// <summary> |
18 |
/// Return true if the update downloader is currently downloading the update |
19 |
/// </summary> |
20 |
bool IsDownloading { get; } |
21 |
|
22 |
/// <summary> |
23 |
/// Event to call when some progress has been made on the download |
24 |
/// </summary> |
25 |
event DownloadProgressEvent DownloadProgressChanged; |
26 |
|
27 |
/// <summary> |
28 |
/// Event to call when the download of the update file has been completed |
29 |
/// </summary> |
30 |
event AsyncCompletedEventHandler DownloadFileCompleted; |
31 |
|
32 |
/// <summary> |
33 |
/// Start the download of the file. The file download should be asynchronous! |
34 |
/// </summary> |
35 |
/// <param name="uri">URL for the download</param> |
36 |
/// <param name="downloadFilePath">Where to download the file</param> |
37 |
void StartFileDownload(Uri uri, string downloadFilePath); |
38 |
|
39 |
/// <summary> |
40 |
/// Cancel the download. |
41 |
/// </summary> |
42 |
void CancelDownload(); |
43 |
|
44 |
/// <summary> |
45 |
/// Clean up and dispose of anything that has to be disposed of |
46 |
/// (cancel the download if needed, etc.) |
47 |
/// </summary> |
48 |
void Dispose(); |
49 |
|
50 |
/// <summary> |
51 |
/// Retrieve the download file name of the app cast item from the server. |
52 |
/// This is useful if the server has any sort of redirects that take place |
53 |
/// when starting the download process. The client will use this file name |
54 |
/// when saving the file on disk. |
55 |
/// NetSparkle.CheckServerFileName = false can be set to avoid this call. |
56 |
/// </summary> |
57 |
/// <param name="item">The AppCastItem that will be downloaded</param> |
58 |
/// <returns>The file name of the file to download from the server |
59 |
/// (including file extension). Null if not found/had error/not applicable.</returns> |
60 |
Task<string> RetrieveDestinationFileNameAsync(AppCastItem item); |
61 |
} |
62 |
} |