ITrackCancel Interface

Provides access to members that control the Cancel Tracker.

Description

The CancelTracker object is the object used by ArcObjects to monitor the Esc key (optionally, the space bar and mouse clicks as well) and to terminate processes at the request of the user. A CancelTracker is typically handed into or created just prior to functions that execute a lengthy operation such as, printing, exporting and drawing.

The ITrackCancel interface provides access to properties and methods that determine if a cancellation has been executed by the user, and also allows developers to specify what actions constitute a cancellation.

Members

Name Description
Method Cancel Cancels the associated operation.
Read/write property CancelOnClick Indicates whether mouse clicks should cancel the operation.
Read/write property CancelOnKeyPress Indicates whether the escape key and spacebar should cancel the operation.
Read/write property CheckTime The interval at which the operation will be interrupted to advance progressors and process messages.
Method Continue Called frequently while associated operation is progressing. A return value of false indicates that the operation should stop.
Read/write property ProcessMessages An obsolete method.
Read/write property Progressor The progressor used to show progress during lengthy operations.
Method Reset Resets the manager after the associated operation is finished.
Method StartTimer An obsolete method.
Method StopTimer An obsolete method.
Read-only property TimerFired An obsolete method.

ITrackCancel.Cancel Method

Cancels the associated operation.

Public Sub Cancel ( _
)
public void Cancel (
);

Description

By default a cancel will occur under the following circumstances:

  • The Esc key was pressed.
  • The space bar was pressed. Use the CancelOnKeyPress property to disable this action.
  • The left or right mouse button was pressed. Use the CancelOnClick property to disable this action.

Whether a cancel occurs will depend on when the key or button was pressed and the CheckTime property. For example, if a map redraw was cancelled by a key press then it is possible that some phases of the redraw will complete before the key press is handled.

ITrackCancel.CancelOnClick Property

Indicates whether mouse clicks should cancel the operation.

Public Property CancelOnClick As Boolean
public bool CancelOnClick {get; set;}

Description

Indicates whether the user can use the left and right mouse buttons to cancel the operation.

ITrackCancel.CancelOnKeyPress Property

Indicates whether the escape key and spacebar should cancel the operation.

Public Property CancelOnKeyPress As Boolean
public bool CancelOnKeyPress {get; set;}

Description

Indicates whether the user can use the space bar to cancel the operation.

ITrackCancel.CheckTime Property

The interval at which the operation will be interrupted to advance progressors and process messages.

Public Property CheckTime As Integer
public int CheckTime {get; set;}

Description

The CheckTime property indicates the frequency the CancelTracker will process any pending Windows (mouse and keyboard) messages. By default the CheckTime is 1000 milliseconds.

ITrackCancel.Continue Method

Called frequently while associated operation is progressing. A return value of false indicates that the operation should stop.

Public Function Continue ( _
) As Boolean
public bool Continue (
);

Description

The Continue method should be called to check whether the user has cancelled the operation. By default a cancel will occur under the following circumstances:

  • The Esc key was pressed.
  • The space bar was pressed.
  • The left or right mouse button was pressed.

If any of these actions occur, the ITrackCancel::Continue method will return false. The logic of the operation should use this indicator to cancel the operation.

The Continue method is only valid during the operation to which it applies, therefore for a drawing operation it can be used in OnBeforeScreenDraw, OnAfterDraw and onAfterScreenDraw event handlers.

A cancelled drawing operation cannot be continued, but you can use the Continue method to determine that the current operation was cancelled and refresh the map if necessary.

ITrackCancel.ProcessMessages Property

An obsolete method.

Public Property ProcessMessages As Boolean
public bool ProcessMessages {get; set;}

Description

Do not use this method as it is obsolete.

ITrackCancel.Progressor Property

The progressor used to show progress during lengthy operations.

Public Property Progressor As IProgressor
public IProgressor Progressor {get; set;}

Description

Use the Progressor property to bind the CancelTracker with a progress object (for example, a progress bar, a progress dialog or a progress animation) that displays the progress of the lengthy operation. Once the Progressor has been set it will be updated automatically as the operation is executed.

Remarks

If the progressor is a step progressor, the MaxRange should be set to equal the number of iterations that the operation will progress through; this number should also match the number of times Continue will be called in the operation�s innermost loop.

ITrackCancel.Reset Method

Resets the manager after the associated operation is finished.

Public Sub Reset ( _
)
public void Reset (
);

Description

The Reset method should be called just before a process that may be cancelled, such as a lengthy operation, begins. The Reset method sets the state of the CancelTracker to uncancelled and returns the internal counter, which is used to update the Progressor to zero.

ITrackCancel.StartTimer Method

An obsolete method.

Public Sub StartTimer ( _
    ByVal hWnd As Integer, _
    ByVal Milliseconds As Integer _
)
public void StartTimer (
    int hWnd,
    int Milliseconds
);

Description

Do not use this method as it is obsolete.

ITrackCancel.StopTimer Method

An obsolete method.

Public Sub StopTimer ( _
)
public void StopTimer (
);

Description

Do not use this method as it is obsolete.

ITrackCancel.TimerFired Property

An obsolete method.

Public ReadOnly Property TimerFired As Boolean
public bool TimerFired {get;}

Description

Do not use this method as it is obsolete.

Classes that implement ITrackCancel

Classes Description

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.