/// <summary> /// Disposes the map object /// </summary> public void Dispose() { _disposing = true; AbortFetch(); if (DisposeLayersOnDispose) { if (Layers != null) { foreach (var disposable in Layers.OfType <IDisposable>()) { disposable.Dispose(); } } if (BackgroundLayer != null) { foreach (var disposable in BackgroundLayer.OfType <IDisposable>()) { disposable.Dispose(); } } } Layers?.Clear(); BackgroundLayer?.Clear(); }
public void Reset() { TextLayer.Clear(); BackgroundLayer.Clear(); SelectionLayer.Clear(); InsertionPoint = new Point(); Chunks.Clear(); CurrentBlockIndex = -1; LastAppendedBlockIndex = -1; MaxAppendedSequence = -1; OverExtentForLayerHeight = 0; OverExtentForViewport = Size.Empty; FirstBlockIndex = LastBlockIndex = -1; }
/// <summary> /// Disposes the map object /// </summary> public void Dispose() { if (DisposeLayersOnDispose) { if (Layers != null) { foreach (ILayer layer in Layers) { if (layer is IDisposable) { ((IDisposable)layer).Dispose(); } } } if (BackgroundLayer != null) { foreach (ILayer layer in BackgroundLayer) { if (layer is IDisposable) { ((IDisposable)layer).Dispose(); } } } if (VariableLayers != null) { foreach (ILayer layer in VariableLayers) { if (layer is IDisposable) { ((IDisposable)layer).Dispose(); } } } } if (Layers != null) { Layers.Clear(); } if (BackgroundLayer != null) { BackgroundLayer.Clear(); } if (VariableLayers != null) { VariableLayers.Clear(); } }