C# Class Nexus.Client.Updating.UpdaterBase

Provides a base implementation of IUpdater.
It is recommended that all updaters derivce from this base class. This class provides helper methods for downloading files, and publishing the status of the update.
Inheritance: ObservableObject, IUpdater
Afficher le fichier Open project: NexusMods/NexusModManager-4.5

Méthodes publiques

Méthode Description
Cancel ( ) : void

Cancels the update.

Update ( ) : bool

Performs the update.

UpdaterBase ( IEnvironmentInfo p_eifEnvironmentInfo ) : System

A simple constructor that initializes the object with the given values.

Méthodes protégées

Méthode Description
DownloadFile ( Uri p_uriUrl ) : string

Downloads the specified file, and returns the local path where the file was saved.

DownloadFileContents ( Uri p_uriUrl ) : byte[]

Downloads the specified file, and returns the file contents.

DownloadFileContentsAsString ( Uri p_uriUrl ) : string

Downloads the specified file, and returns the file contents as a string.

SetMessage ( string p_strMessage ) : void

Sets the updater's Message.

SetProgress ( Int32 p_intProgress ) : void

Sets the updater's Progress.

SetProgressMaximum ( Int32 p_intMaximum ) : void

Sets the updater's ProgressMaximum.

SetRequiresRestart ( bool p_booRequiresRestart ) : void

Sets the updater's RequiresRestart.

Private Methods

Méthode Description
DefaultConfirm ( string p_strMessage, string p_strTitle ) : bool

The default confirm method.

Downloader_DownloadComplete ( object sender, CompletedDownloadEventArgs e ) : void

Handles the FileDownloader.DownloadComplete event of the file downloader.

This stops the updating of the progress properties.

Method Details

Cancel() public méthode

Cancels the update.
public Cancel ( ) : void
Résultat void

DownloadFile() protected méthode

Downloads the specified file, and returns the local path where the file was saved.
protected DownloadFile ( Uri p_uriUrl ) : string
p_uriUrl System.Uri The URL of the file to download.
Résultat string

DownloadFileContents() protected méthode

Downloads the specified file, and returns the file contents.
protected DownloadFileContents ( Uri p_uriUrl ) : byte[]
p_uriUrl System.Uri The URL of the file to download.
Résultat byte[]

DownloadFileContentsAsString() protected méthode

Downloads the specified file, and returns the file contents as a string.
protected DownloadFileContentsAsString ( Uri p_uriUrl ) : string
p_uriUrl System.Uri The URL of the file to download.
Résultat string

SetMessage() protected méthode

Sets the updater's Message.
protected SetMessage ( string p_strMessage ) : void
p_strMessage string The updater's new message.
Résultat void

SetProgress() protected méthode

Sets the updater's Progress.
protected SetProgress ( Int32 p_intProgress ) : void
p_intProgress System.Int32 The updater's new progress.
Résultat void

SetProgressMaximum() protected méthode

Sets the updater's ProgressMaximum.
protected SetProgressMaximum ( Int32 p_intMaximum ) : void
p_intMaximum System.Int32 The new maximum to use for the updater's progress.
Résultat void

SetRequiresRestart() protected méthode

Sets the updater's RequiresRestart.
protected SetRequiresRestart ( bool p_booRequiresRestart ) : void
p_booRequiresRestart bool The updater's new requires restart value.
Résultat void

Update() public abstract méthode

Performs the update.
public abstract Update ( ) : bool
Résultat bool

UpdaterBase() public méthode

A simple constructor that initializes the object with the given values.
public UpdaterBase ( IEnvironmentInfo p_eifEnvironmentInfo ) : System
p_eifEnvironmentInfo IEnvironmentInfo The application's envrionment info.
Résultat System