void IDisposable.Dispose() { if (_mosaicProjectionFileProvider != null) { _mosaicProjectionFileProvider.DataIdentifyChanged -= new Action <DataIdentify, IRasterDataProvider>(_mosaicProjectionFileProvider_DataIdentifyChanged); _mosaicProjectionFileProvider.Dispose(); _mosaicProjectionFileProvider.Clear(); } if (_curFileHost != null) { _curFileHost.Dispose(); _curFileHost = null; } if (_aoiHost != null) { _aoiHost.Dispose(); _aoiHost = null; } if (_simpleMapControl != null) { (_simpleMapControl as UCSimpleMapControl).AOIIsChanged -= new EventHandler(map_AOIIsChanged); (_simpleMapControl as UCSimpleMapControl).Dispose(); _simpleMapControl = null; } ucPrjEnvelopes1.OnEnvelopeChanged -= new EventHandler(ucPrjEnvelopes1_OnEnvelopeChanged); tvInputFiles.NodeMouseDoubleClick -= new TreeNodeMouseClickEventHandler(treeView1_NodeMouseDoubleClick); _progress = null; }
void UCSimpleMapControl_Disposed(object sender, EventArgs e) { if (_objHosts != null && _objHosts.Count != 0) { foreach (string key in _objHosts.Keys) { ISimpleVectorObjectHost host = _objHosts[key]; if (host != null) { host.Dispose(); } } _objHosts.Clear(); } if (_aoiContainer != null) { (_aoiContainer as AOIContainerLayer).Dispose(); _aoiContainer = null; } if (_vectorHostLayer != null) { (_vectorHostLayer as VectorHostLayer).Dispose(); _vectorHostLayer = null; } if (_geoGridLayer != null) { _geoGridLayer.Dispose(); _geoGridLayer = null; } if (canvasHost1 != null) { canvasHost1.Canvas.Dispose(); canvasHost1.Dispose(); //canvasHost1 = null; } }