ArcGIS Explorer Component Help |
MapDisplay..::.SuspendDisplay Method |
MapDisplay Class Example See Also |
Disables any redrawing of the map display.
Namespace:
ESRI.ArcGISExplorer.MappingAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public IDisposable SuspendDisplay() |
Visual Basic (Declaration) |
---|
Public Function SuspendDisplay As IDisposable |
Return Value
An IDisposable object that enables redrawing of the map when its Dispose method is called.Remarks
To maintain performance while items are added to the map, call the SuspendDisplay method. This method prevents the display from
drawing and returns an IDisposable object. The display will resume drawing when the Dispose method is called on the returned IDisposable
object. Dispose is commonly called implicitly by utilizing a 'using' statement: any class instance defined in the parameter list of a 'using' keyword
has its Dispose method called on exit of the associated code block.
Examples
The code below illustrates how to use this method to suspend the map display whilst ten notes are added to the map.
CopyC#
//Calling suspend display temporarily suspends updates to the map display IDisposable suspendedDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.SuspendDisplay(); //Typically you will use this method when you are adding several items to the map //in order to improve performance and minimize flicker. //e.g. This loop adds ten notes to the map for (int i = 0; i < 10; i++) { Note note = new Note("Note" + i.ToString(), new ESRI.ArcGISExplorer.Geometry.Point(i, i)); ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(note); } //Calling dispose resumes updates to the map display suspendedDisplay.Dispose(); //You can also use the using keyword in association with SuspendDisplay which will implicitly //call Dispose at the end of the using block using (ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.SuspendDisplay()) { for (int i = 0; i < 10; i++) { Note note = new Note("Note" + i.ToString(), new ESRI.ArcGISExplorer.Geometry.Point(i, i)); ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(note); } }
CopyVB.NET
'Calling suspend display temporarily suspends updates to the map display Dim suspendedDisplay As IDisposable = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.SuspendDisplay() 'Typically you will use this method when you are adding several items to the map 'in order to improve performance and minimize flicker. 'e.g. This loop adds ten notes to the map For i As Integer = 0 To 9 Dim note As New Note("Note" & i.ToString(), New ESRI.ArcGISExplorer.Geometry.Point(i, i)) ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(note) Next 'Calling dispose resumes updates to the map display suspendedDisplay.Dispose() 'You can also use the using keyword in association with SuspendDisplay which will implicitly 'call Dispose at the end of the using block Using ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.SuspendDisplay() For i As Integer = 0 To 9 Dim note As New Note("Note" & i.ToString(), New ESRI.ArcGISExplorer.Geometry.Point(i, i)) ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.ChildItems.Add(note) Next End Using