A background operation that emits a given number of ticks over a specified time interval, while doing nothing else.
sealed class
|
TestOperation
|
extends
|
Operation
|
The configurator object for this type.
public
static
property
|
Config
{
get
}
|
||
type
|
IConfigurator<IOperation>
|
||
value
|
|
The configurator object. |
Returns the configuration value that describes this object.
public
override
method
|
ToConfig
()
|
||
type
|
ConfigValue
|
||
returns
|
|
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.
Returns the lifecycle state of this object.
public
virtual
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Disposable.LifecycleState
|
Returns the human-readable name of this background operation.
public
override
property
|
Name
{
get
}
|
||
type
|
string
|
||
value
|
|
The name. | |
implements
|
Operation.Name
|
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
.
The weight of this operation.
public
virtual
property
|
Weight
{
get
}
|
||
type
|
int32
|
||
value
|
|
The weight of this operation. | |
inherited
|
Operation.Weight
|
Remarks:
This value is only used for reporting progress when combining multiple operations.
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 .
|
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.
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
|
|
The resulting IOperation object. | ||
inherited
|
Operation.And
|
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.
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.
Runs the operation.
public
override
method
|
Run
(IProgressMonitor progress)
|
||
params
|
progress
|
[not-null]
|
The progress monitor object to use. |
implements
|
Operation.Run
|
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
|
|
The resulting IOperation object. | ||
inherited
|
Operation.Then
|
Validates the state of this object.
public
virtual
method
|
Validate
(Validator validator)
|
||
params
|
validator
|
[not-null]
|
The validator object. |
inherited
|
Operation.Validate
|