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
Exibir arquivo Open project: NexusMods/NexusModManager-4.5

Public Methods

Method 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.

Protected Methods

Method 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

Method 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 method

Cancels the update.
public Cancel ( ) : void
return void

DownloadFile() protected method

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.
return string

DownloadFileContents() protected method

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.
return byte[]

DownloadFileContentsAsString() protected method

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.
return string

SetMessage() protected method

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

SetProgress() protected method

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

SetProgressMaximum() protected method

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.
return void

SetRequiresRestart() protected method

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

Update() public abstract method

Performs the update.
public abstract Update ( ) : bool
return bool

UpdaterBase() public method

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.
return System