프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / MarkusAutoUpdate / src / NetSparkle / Interfaces / IAppCastHandler.cs @ d60f94ee

이력 | 보기 | 이력해설 | 다운로드 (2.59 KB)

1
using NetSparkleUpdater.Configurations;
2
using System;
3
using System.Collections.Generic;
4
using System.Text;
5

    
6
namespace NetSparkleUpdater.Interfaces
7
{
8
    /// <summary>
9
    /// Interface used by objects that initiate a download process
10
    /// for an app cast, perform any needed signature verification on
11
    /// the app cast, and parse the app cast's items into a list of
12
    /// <see cref="AppCastItem"/>.
13
    /// Implement this interface if you would like to use a custom parsing
14
    /// method for your app cast that isn't yet built into NetSparkle.
15
    /// </summary>
16
    public interface IAppCastHandler
17
    {
18
        /// <summary>
19
        /// Setup the app cast handler info for downloading and parsing app cast information
20
        /// </summary>
21
        /// <param name="dataDownloader">downloader that will manage the app cast download 
22
        /// (provided by <see cref="SparkleUpdater"/> via the 
23
        /// <see cref="SparkleUpdater.AppCastDataDownloader"/> property.</param>
24
        /// <param name="castUrl">full URL to the app cast file</param>
25
        /// <param name="config">configuration for handling update intervals/checks 
26
        /// (user skipped versions, etc.)</param>
27
        /// <param name="signatureVerifier">Object to check signatures of app cast information</param>
28
        /// <param name="logWriter">object that you can utilize to do any necessary logging</param>
29
        void SetupAppCastHandler(IAppCastDataDownloader dataDownloader, string castUrl, Configuration config,
30
            ISignatureVerifier signatureVerifier, ILogger logWriter = null);
31

    
32
        /// <summary>
33
        /// Download the app cast file via the <see cref="IAppCastDataDownloader"/> 
34
        /// object and parse the downloaded information.
35
        /// If this function is successful, <see cref="SparkleUpdater"/> will call <see cref="GetAvailableUpdates"/>
36
        /// to get the <see cref="AppCastItem"/> information.
37
        /// Note that you must handle your own exceptions if they occur. Otherwise, <see cref="SparkleUpdater"/>
38
        /// will act as though the appc ast failed to download.
39
        /// </summary>
40
        /// <returns>true if downloading and parsing succeeded; false otherwise</returns>
41
        bool DownloadAndParse();
42

    
43
        /// <summary>
44
        /// Retrieve the available updates from the app cast.
45
        /// This should be called after <see cref="DownloadAndParse"/> has
46
        /// successfully completed.
47
        /// </summary>
48
        /// <returns>a list of <see cref="AppCastItem"/> updates. Can be empty if no updates are available.</returns>
49
        List<AppCastItem> GetAvailableUpdates();
50
    }
51
}
클립보드 이미지 추가 (최대 크기: 500 MB)