OpenTAP 9.27
API Reference
Public Member Functions | Protected Member Functions | Static Protected Attributes | Events | List of all members
OpenTap.Package.PackageAction Class Referenceabstract

Indicates a well defined action to be performed on a package. A number of common actions are PackageInstallAction, PackageUninstallAction, and PackageDownloadAction. Deriving from this, and annotating the class and any public properties with CommandLineArgumentAttribute and UnnamedCommandLineArgument attributes will allow it to be called from the OpenTAP.Package CLI. More...

Inheritance diagram for OpenTap.Package.PackageAction:
OpenTap.Cli.ICliAction OpenTap.ITapPlugin OpenTap.Package.LockingPackageAction OpenTap.Package.PackageCreateAction OpenTap.Package.CacheAction OpenTap.Package.IsolatedPackageAction

Public Member Functions

delegate void ProgressUpdateDelegate (int progressPercent, string message)
 A delegate used by ProgressUpdate More...
 
delegate void ErrorDelegate (Exception ex)
 A delegate type used by the Error event. More...
 
abstract int Execute (CancellationToken cancellationToken)
 The code to be executed by the action. More...
 

Protected Member Functions

void RaiseError (Exception ex)
 Call this to raise the Error event. More...
 
void RaiseProgressUpdate (int progressPercent, string message)
 Call this to raise the ProgressUpdate event. More...
 

Static Protected Attributes

static TraceSource log = OpenTap.Log.CreateSource("PackageAction")
 Log source for PackageAction plugins.
 

Events

ProgressUpdateDelegate ProgressUpdate
 Called by the action to indicate how far it has gotten. Will usually be called with a progressPercent of 100 to indicate that it is done.
 
ErrorDelegate Error
 Called when a critical error happens.
 

Detailed Description

Indicates a well defined action to be performed on a package. A number of common actions are PackageInstallAction, PackageUninstallAction, and PackageDownloadAction. Deriving from this, and annotating the class and any public properties with CommandLineArgumentAttribute and UnnamedCommandLineArgument attributes will allow it to be called from the OpenTAP.Package CLI.

Member Function Documentation

◆ ErrorDelegate()

delegate void OpenTap.Package.PackageAction.ErrorDelegate ( Exception  ex)

A delegate type used by the Error event.

Parameters
ex

◆ Execute()

abstract int OpenTap.Package.PackageAction.Execute ( CancellationToken  cancellationToken)
pure virtual

The code to be executed by the action.

Returns
Return 0 to indicate success. Otherwise return a custom errorcode that will be set as the exitcode from the CLI.

Implements OpenTap.Cli.ICliAction.

Implemented in OpenTap.Package.PackageCreateAction, OpenTap.Package.IsolatedPackageAction, and OpenTap.Package.LockingPackageAction.

◆ ProgressUpdateDelegate()

delegate void OpenTap.Package.PackageAction.ProgressUpdateDelegate ( int  progressPercent,
string  message 
)

A delegate used by ProgressUpdate

Parameters
progressPercentIndicates progress from 0 to 100.
message

◆ RaiseError()

void OpenTap.Package.PackageAction.RaiseError ( Exception  ex)
inlineprotected

Call this to raise the Error event.

Parameters
ex

◆ RaiseProgressUpdate()

void OpenTap.Package.PackageAction.RaiseProgressUpdate ( int  progressPercent,
string  message 
)
inlineprotected

Call this to raise the ProgressUpdate event.

Parameters
progressPercent
message

OpenTAP 9.27 API built Wed Nov 27 2024 13:14:46