TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class TestOperation in Tinman.AddOns.Application

A background operation that emits a given number of ticks over a specified time interval, while doing nothing else.

sealed class TestOperation extends Operation

Configuration

Config

The configurator object for this type.

public static property Config { get }
type IConfigurator<IOperation>
value [not-null] The configurator object.

ToConfig

Returns the configuration value that describes this object.

public override method ToConfig ()
type ConfigValue
returns [not-null] The configuration value.
implements Operation.ToConfig

Remarks:

All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.

The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.

Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.

Public / Attributes

LifecycleState

Returns the lifecycle state of this object.

public virtual property LifecycleState { get }
type LifecycleState
value The lifecycle state.
inherited Disposable.LifecycleState

Name

Returns the human-readable name of this background operation.

public override property Name { get }
type string
value [not-null] The name.
implements Operation.Name

ShallCancel

Shall the background operation cancel?

public property ShallCancel { get }
type bool
value true if the operation shall cancel, false if not.
inherited Operation.ShallCancel

Remarks:

Once Cancel has been called, this property will return true.

Weight

The weight of this operation.

public virtual property Weight { get }
type int32
value [0..100] The weight of this operation.
inherited Operation.Weight

Remarks:

This value is only used for reporting progress when combining multiple operations.

Public / Constructors

TestOperation

Creates a new instance of TestOperation.

public constructor TestOperation (int32 ticks = 20, int32 sleep = 50, bool fail = false, string name = null)
params ticks [>0] Total number of progress ticks.
  sleep [>0] Number of milliseconds to sleep before each tick.
  fail Operation will fail?
  name Name of the operation. If null, 'Test' will be used. Defaults to null.

Public / Methods

AcquireTry

Acquires a strong reference to this disposable object.

[OwnerReturn, ThreadSafe]
public method AcquireTry ()
type IDisposable
returns this if a new strong reference has been acquired, null if this object is already being disposed.
inherited Disposable.AcquireTry

Remarks:

The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.

This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.

And

Returns an IOperation object that simultaneously executes this operation and the given one.

[OwnerReturn, OwnerThis]
public virtual method And ([Owner] IOperation operation)
type IOperation
params operation [not-null] The other operation.
returns [not-null] The resulting IOperation object.
inherited Operation.And

Cancel

Requests that the running background operation gracefully terminates.

public virtual method Cancel ()
inherited Operation.Cancel

Remarks:

An IOperation is free to honor a cancel request or to ignore it. Cancelling a background operation should be considered as a hint to terminate as soon as possible.

Dispose

Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.

[Dispose, OwnerThis, ThreadSafe]
public method Dispose ()
inherited Disposable.Dispose

Remarks:

The Dispose method silently returns if the object has already been disposed.

Run

Runs the operation.

public override method Run (IProgressMonitor progress)
params progress [not-null] The progress monitor object to use.
implements Operation.Run

Then

Returns an IOperation object that executes this operation, followed by the given operation.

[OwnerReturn, OwnerThis]
public virtual method Then ([Owner] IOperation operation)
type IOperation
params operation [not-null] The other operation.
returns [not-null] The resulting IOperation object.
inherited Operation.Then

Validate

Validates the state of this object.

public virtual method Validate (Validator validator)
params validator [not-null] The validator object.
inherited Operation.Validate