Table of Contents

Class UpdatingSession

Namespace
CarinaStudio.AutoUpdate.ViewModels
Assembly
CarinaStudio.AppBase.AutoUpdate.dll

Base class of view-model of auto updating session.

public abstract class UpdatingSession : ViewModel, IDisposable, IApplicationObject, IThreadDependent, ISynchronizable, INotifyPropertyChanged
Inheritance
UpdatingSession
Implements
Inherited Members
Extension Methods

Constructors

UpdatingSession(IApplication)

Initialize new UpdatingSession instance.

protected UpdatingSession(IApplication app)

Parameters

app IApplication

Application.

Fields

ApplicationNameProperty

Property of ApplicationName

public static readonly ObservableProperty<string?> ApplicationNameProperty

Field Value

ObservableProperty<string>

DownloadedPackageSizeProperty

public static readonly ObservableProperty<long> DownloadedPackageSizeProperty

Field Value

ObservableProperty<long>

IsBackingUpApplicationProperty

public static readonly ObservableProperty<bool> IsBackingUpApplicationProperty

Field Value

ObservableProperty<bool>

IsDownloadingPackageProperty

public static readonly ObservableProperty<bool> IsDownloadingPackageProperty

Field Value

ObservableProperty<bool>

IsInstallingPackageProperty

Property of IsInstallingPackage

public static readonly ObservableProperty<bool> IsInstallingPackageProperty

Field Value

ObservableProperty<bool>

IsProgressAvailableProperty

Property of IsProgressAvailable

public static readonly ObservableProperty<bool> IsProgressAvailableProperty

Field Value

ObservableProperty<bool>

IsRefreshingApplicationIconProperty

public static readonly ObservableProperty<bool> IsRefreshingApplicationIconProperty

Field Value

ObservableProperty<bool>

IsResolvingPackageProperty

Property of IsResolvingPackage

public static readonly ObservableProperty<bool> IsResolvingPackageProperty

Field Value

ObservableProperty<bool>

IsRestoringApplicationProperty

public static readonly ObservableProperty<bool> IsRestoringApplicationProperty

Field Value

ObservableProperty<bool>

IsUpdatingCancelledProperty

Property of IsUpdatingCancelled

public static readonly ObservableProperty<bool> IsUpdatingCancelledProperty

Field Value

ObservableProperty<bool>

IsUpdatingCancellingProperty

public static readonly ObservableProperty<bool> IsUpdatingCancellingProperty

Field Value

ObservableProperty<bool>

IsUpdatingCompletedProperty

Property of IsUpdatingCompleted

public static readonly ObservableProperty<bool> IsUpdatingCompletedProperty

Field Value

ObservableProperty<bool>

IsUpdatingFailedProperty

Property of IsUpdatingFailed

public static readonly ObservableProperty<bool> IsUpdatingFailedProperty

Field Value

ObservableProperty<bool>

IsUpdatingProperty

Property of IsUpdating

public static readonly ObservableProperty<bool> IsUpdatingProperty

Field Value

ObservableProperty<bool>

IsUpdatingSucceededProperty

Property of IsUpdatingSucceeded

public static readonly ObservableProperty<bool> IsUpdatingSucceededProperty

Field Value

ObservableProperty<bool>

IsVerifyingPackageProperty

Property of IsVerifyingPackage

public static readonly ObservableProperty<bool> IsVerifyingPackageProperty

Field Value

ObservableProperty<bool>

MessageProperty

Property of Message

public static readonly ObservableProperty<string?> MessageProperty

Field Value

ObservableProperty<string>

PackageSizeProperty

Property of PackageSize

public static readonly ObservableProperty<long?> PackageSizeProperty

Field Value

ObservableProperty<long?>

ProgressPercentageProperty

Property of ProgressPercentage

public static readonly ObservableProperty<double> ProgressPercentageProperty

Field Value

ObservableProperty<double>

RefreshApplicationIconAutomaticallyProperty

public static readonly ObservableProperty<bool> RefreshApplicationIconAutomaticallyProperty

Field Value

ObservableProperty<bool>

RefreshApplicationIconMessageProperty

public static readonly ObservableProperty<string?> RefreshApplicationIconMessageProperty

Field Value

ObservableProperty<string>

Properties

ApplicationBaseVersion

Get or set base version of application to update.

public Version? ApplicationBaseVersion { get; set; }

Property Value

Version

ApplicationDirectoryPath

Get or set path to directory of application to update.

public string? ApplicationDirectoryPath { get; set; }

Property Value

string

ApplicationName

Get or set name of application to update.

public string? ApplicationName { get; set; }

Property Value

string

CancelUpdatingCommand

Command to cancel updating process.

public ICommand CancelUpdatingCommand { get; }

Property Value

ICommand

DownloadedPackageSize

Get size of downloaded package in bytes.

public long DownloadedPackageSize { get; }

Property Value

long

IsBackingUpApplication

Check whether application is being backed-up or not.

public bool IsBackingUpApplication { get; }

Property Value

bool

IsDownloadingPackage

Check whether update package is being downloaded or not.

public bool IsDownloadingPackage { get; }

Property Value

bool

IsInstallingPackage

Check whether update package is being installed or not.

public bool IsInstallingPackage { get; }

Property Value

bool

IsProgressAvailable

Check whether progress of updating is available or not.

public bool IsProgressAvailable { get; }

Property Value

bool

IsRefreshingApplicationIcon

Check whether application icon refreshing is being performed or not.

public bool IsRefreshingApplicationIcon { get; }

Property Value

bool

IsResolvingPackage

Check whether update package is being resolved or not.

public bool IsResolvingPackage { get; }

Property Value

bool

IsRestoringApplication

Check whether application is being restored or not.

public bool IsRestoringApplication { get; }

Property Value

bool

IsUpdating

Check whether updating processing is on-going or not.

public bool IsUpdating { get; }

Property Value

bool

IsUpdatingCancelled

Check whether updating processing is cancelled or not.

public bool IsUpdatingCancelled { get; }

Property Value

bool

IsUpdatingCancelling

Check whether updating processing is being cancelled or not.

public bool IsUpdatingCancelling { get; }

Property Value

bool

IsUpdatingCompleted

Check whether updating processing is completed either successfully or unsuccessfully.

public bool IsUpdatingCompleted { get; }

Property Value

bool

IsUpdatingFailed

Check whether updating processing is completed unsuccessfully or not.

public bool IsUpdatingFailed { get; }

Property Value

bool

IsUpdatingSucceeded

Check whether updating processing is completed successfully or not.

public bool IsUpdatingSucceeded { get; }

Property Value

bool

IsVerifyingPackage

Check whether downloaded update package is being verified or not.

public bool IsVerifyingPackage { get; }

Property Value

bool

Message

Get message which describes status of updating.

public string? Message { get; }

Property Value

string

PackageManifestSource

Get or set source of package manifest.

public IStreamProvider? PackageManifestSource { get; set; }

Property Value

IStreamProvider

PackageRequestHeaders

Get collection of custom headers for requesting package download.

public IDictionary<string, string> PackageRequestHeaders { get; }

Property Value

IDictionary<string, string>

PackageSize

Get size of package in bytes.

public long? PackageSize { get; }

Property Value

long?

ProgressPercentage

Get current progress of updating in percentage. NaN if progress is unavailable.

public double ProgressPercentage { get; }

Property Value

double

RefreshApplicationIconAutomatically

Get or set whether refreshing application should be performed when needed or not.

public bool RefreshApplicationIconAutomatically { get; set; }

Property Value

bool

RefreshApplicationIconMessage

Get or set message for refreshing application icon.

public string? RefreshApplicationIconMessage { get; set; }

Property Value

string

SelfContainedPackageOnly

Get or set whether only self-contained update package can be selected or not.

public bool SelfContainedPackageOnly { get; set; }

Property Value

bool

StartUpdatingCommand

Command to start updating process.

public ICommand StartUpdatingCommand { get; }

Property Value

ICommand

UpdaterProgress

Get progress reported by internal Updater.

protected double UpdaterProgress { get; }

Property Value

double

UpdaterState

Get state of internal Updater.

protected UpdaterState UpdaterState { get; }

Property Value

UpdaterState

UpdatingVersion

Get version of application which is updating to.

protected Version? UpdatingVersion { get; }

Property Value

Version

Methods

CreatePackageResolver(IStreamProvider)

Create IPackageResolver before updating process start.

protected virtual IPackageResolver CreatePackageResolver(IStreamProvider source)

Parameters

source IStreamProvider

Source of package manifest.

Returns

IPackageResolver

IPackageResolver.

Remarks

Will create XmlPackageResolver by default implementation.

Dispose(bool)

Dispose the instance.

protected override void Dispose(bool disposing)

Parameters

disposing bool

True to dispose managed resources.

OnPropertyChanged(ObservableProperty, object?, object?)

Called when property changed.

protected override void OnPropertyChanged(ObservableProperty property, object? oldValue, object? newValue)

Parameters

property ObservableProperty

Changed property.

oldValue object

Old value.

newValue object

New value.

OnUpdaterProgressChanged()

Called when progress reported by internal Updater changed.

protected virtual void OnUpdaterProgressChanged()

OnUpdaterStateChanged()

Called when state of internal Updater changed.

protected virtual void OnUpdaterStateChanged()