A synchronous (blocking) call returning a new Geometry at the clicked location. The tracked shape will have the specified color.

Namespace:  ESRI.ArcGISExplorer.Mapping

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public Geometry TrackMoveGeometry(
	Geometry geometry,
	Color color
)
Visual Basic (Declaration)
Public Function TrackMoveGeometry ( _
	geometry As Geometry, _
	color As Color _
) As Geometry

Parameters

geometry
Type: ESRI.ArcGISExplorer.Geometry..::.Geometry

The Geometry to be moved.
color
Type: System.Drawing..::.Color

The color of the tracked Geometry while it is being moved.

Return Value

A new Geometry at the clicked location. The shape is based on the input geometry but translated to the new location.

Remarks

This method will block the user interface (UI) thread until the user has clicked on the display. The method can be cancelled if the ESC key is pressed after the method has been called or the CancelTracking()()() method is called; in this case the method will return nullNothingnullptra null reference (Nothing in Visual Basic).

If you are using this method to move a Graphic or Note remember that you will need to update the Geometry property with that of the tracked geometry to actually move it, see the code example below.

Alternatively you may wish to use an asynchronous equivalent, see the BeginTrackMoveGeometry methods.

Version Information: This method is supported from version 2.0.0.1500.

Examples

The code below demonstrates how to use the TrackMoveGeometry methods to move a Graphic to a new location.
CopyC#
//Return the map display
ESRI.ArcGISExplorer.Mapping.MapDisplay disp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;
Graphic targetGraphic = null;

//Find a particular Graphic by it's Tag property
foreach (Graphic graphic in disp.Graphics)
{
  if (graphic.Tag.ToString() == "LineTarget")
  {
    targetGraphic = graphic;
    break;
  }
}

if (targetGraphic != null)
{
  //Track the 'LineTarget' geometry to a new location
  ESRI.ArcGISExplorer.Geometry.Geometry movedTargetGeometry = disp.TrackMoveGeometry(targetGraphic.Geometry);
  //Update the Graphics Geometry to be the tracked geoemtry
  targetGraphic.Geometry = movedTargetGeometry;
}
CopyVB.NET
'Return the map display
Dim disp As ESRI.ArcGISExplorer.Mapping.MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay
Dim targetGraphic As Graphic = Nothing

'Find a particular Graphic by its Tag property
For Each graphic As Graphic In disp.Graphics
  If graphic.Tag.ToString() = "LineTarget" Then
    targetGraphic = graphic
    Exit For
  End If
Next

If targetGraphic IsNot Nothing Then
  'Track the 'LineTarget' geometry to a new location
  Dim movedTargetGeometry As ESRI.ArcGISExplorer.Geometry.Geometry = disp.TrackMoveGeometry(targetGraphic.Geometry)
  'Update the Graphics Geometry to be the tracked geoemtry
  targetGraphic.Geometry = movedTargetGeometry
End If

See Also