C# 클래스 Ketarin.Updater

Handles the updating process of a list of application jobs.
파일 보기 프로젝트 열기: GitSullied/Ketarin 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
m_LastProgress int

공개 메소드들

메소드 설명
BeginCheckForOnlineUpdates ( ApplicationJob jobs ) : void

Checks for which of the given applications updates are available asynchronously.

BeginUpdate ( ApplicationJob jobs, bool onlyCheck, bool installUpdated ) : void

Starts one or more threads which update the given applications asynchronously.

Cancel ( ) : void

Cancels the updating progress.

GetDownloadSize ( ApplicationJob job ) : long

Returns the download size of a given application in bytes.

GetProgress ( ApplicationJob job ) : short

Returns the progress of the given application.

GetStatus ( ApplicationJob job ) : Status

Returns the current status of a given application.

보호된 메소드들

메소드 설명
DoDownload ( ApplicationJob job, Uri urlToRequest ) : Status

Executes the actual download from an URL. Does not handle exceptions, but takes care of proper cleanup.

DoDownload ( ApplicationJob job, string &requestedUrl ) : Status

Executes the actual download (determines the URL to download from). Does not handle exceptions, but takes care of proper cleanup.

OnProgressChanged ( long pos, long length, ApplicationJob job ) : void

Fires the ProgressChangedEvent. Only fires if the progress value has changed significantly to prevent (for example) too frequent GUI updates.

OnStatusChanged ( ApplicationJob job ) : void

Fires the StatusChanged event.

OnUpdateCompleted ( ) : void

Fires the UpdateCompleted event.

OnUpdatesFound ( string updatedApps ) : void

Fires the UpdatesFound.

비공개 메소드들

메소드 설명
AddRequestToCancel ( WebRequest reqest ) : void

Allows all routines involved in the update to store the corresponding WebRequest here. When the user cancels the process, these WebRequests wil be aborted, so that it finishes more or less instantly.

CheckForOnlineUpdates ( object argument ) : void

Checks for which of the given applications updates are available. Fires an event when finished.

GetBaseHost ( Uri uri ) : string

Determines the base host (TLD + server name) of an URI.

GetContentLength ( WebResponse response ) : long

Determines the actual content length in a more reliable way for FTP downloads.

StartNewThread ( object paramJob ) : void

Performs the update process of a single application. Catches most exceptions and stores them for later use.

UpdateApplications ( ) : void

Performs the actual update check for the current applications. Starts multiple threads if necessary.

메소드 상세

BeginCheckForOnlineUpdates() 공개 메소드

Checks for which of the given applications updates are available asynchronously.
public BeginCheckForOnlineUpdates ( ApplicationJob jobs ) : void
jobs ApplicationJob
리턴 void

BeginUpdate() 공개 메소드

Starts one or more threads which update the given applications asynchronously.
public BeginUpdate ( ApplicationJob jobs, bool onlyCheck, bool installUpdated ) : void
jobs ApplicationJob
onlyCheck bool Specifies whether or not to download the updates
installUpdated bool
리턴 void

Cancel() 공개 메소드

Cancels the updating progress.
public Cancel ( ) : void
리턴 void

DoDownload() 보호된 메소드

Executes the actual download from an URL. Does not handle exceptions, but takes care of proper cleanup.
This exception is thrown, if the resulting file is not of a binary type This exception is thrown, if the resulting target path of an application is not valid
protected DoDownload ( ApplicationJob job, Uri urlToRequest ) : Status
job ApplicationJob The job to process
urlToRequest System.Uri URL from which should be downloaded
리턴 Status

DoDownload() 보호된 메소드

Executes the actual download (determines the URL to download from). Does not handle exceptions, but takes care of proper cleanup.
protected DoDownload ( ApplicationJob job, string &requestedUrl ) : Status
job ApplicationJob The job to process
requestedUrl string The URL from which has been downloaded
리턴 Status

GetDownloadSize() 공개 메소드

Returns the download size of a given application in bytes.
public GetDownloadSize ( ApplicationJob job ) : long
job ApplicationJob
리턴 long

GetProgress() 공개 메소드

Returns the progress of the given application.
public GetProgress ( ApplicationJob job ) : short
job ApplicationJob
리턴 short

GetStatus() 공개 메소드

Returns the current status of a given application.
public GetStatus ( ApplicationJob job ) : Status
job ApplicationJob
리턴 Status

OnProgressChanged() 보호된 메소드

Fires the ProgressChangedEvent. Only fires if the progress value has changed significantly to prevent (for example) too frequent GUI updates.
protected OnProgressChanged ( long pos, long length, ApplicationJob job ) : void
pos long Current position of the stream
length long Total length of the stream
job ApplicationJob Current ApplicationJob
리턴 void

OnStatusChanged() 보호된 메소드

Fires the StatusChanged event.
protected OnStatusChanged ( ApplicationJob job ) : void
job ApplicationJob
리턴 void

OnUpdateCompleted() 보호된 메소드

Fires the UpdateCompleted event.
protected OnUpdateCompleted ( ) : void
리턴 void

OnUpdatesFound() 보호된 메소드

Fires the UpdatesFound.
protected OnUpdatesFound ( string updatedApps ) : void
updatedApps string
리턴 void

프로퍼티 상세

m_LastProgress 보호되어 있는 프로퍼티

protected int m_LastProgress
리턴 int