bovender framework
C# framework that implements MVVM and more
Bovender.Mvvm.Models.ProcessModel Class Referenceabstract

Abstract base class for models that perform a lengthy process asynchronously. More...

Inheritance diagram for Bovender.Mvvm.Models.ProcessModel:
Bovender.Mvvm.Models.IProcessModel Bovender.UnitTests.Mvvm.ProcessModelForTesting Bovender.Versioning.ReleaseInfo Bovender.Versioning.Updater Bovender.UnitTests.Mvvm.ExceptionProcessModelForTesting Bovender.UnitTests.Versioning.ReleaseInfoForTesting

Public Member Functions

void Cancel ()
 Cancels the current process More...
 
abstract bool Execute ()
 This method may be called by a ProcessViewModelBase-derived class in a worker task that wraps this method in a try...catch structure. More...
 

Protected Member Functions

virtual void OnCancelling ()
 

Properties

ProcessModel Dependent [get, set]
 
bool IsCancellationRequested [get, set]
 This property is set to true by the Cancel() method. More...
 

Events

EventHandler< ProcessModelEventArgsCancelling
 

Detailed Description

Abstract base class for models that perform a lengthy process asynchronously.

This class is indended to be used with Bovender.Mvvm.ViewModels.ProcessViewModelBase.

Definition at line 30 of file ProcessModel.cs.

Member Function Documentation

void Bovender.Mvvm.Models.ProcessModel.Cancel ( )
inline

Cancels the current process

Implements Bovender.Mvvm.Models.IProcessModel.

Definition at line 37 of file ProcessModel.cs.

abstract bool Bovender.Mvvm.Models.ProcessModel.Execute ( )
pure virtual

This method may be called by a ProcessViewModelBase-derived class in a worker task that wraps this method in a try...catch structure.

The implementation does not need to and should not handle tasks or threads itself.

Returns
True if successful, false if failed or cancelled.

Implements Bovender.Mvvm.Models.IProcessModel.

Implemented in Bovender.Versioning.Updater, Bovender.Versioning.ReleaseInfo, Bovender.UnitTests.Mvvm.ProcessModelForTesting, and Bovender.UnitTests.Mvvm.ExceptionProcessModelForTesting.

Property Documentation

bool Bovender.Mvvm.Models.ProcessModel.IsCancellationRequested
getsetprotected

This property is set to true by the Cancel() method.

The implementation of the Execute method should query this property during the process.

Definition at line 87 of file ProcessModel.cs.


The documentation for this class was generated from the following file: