public void Dispose() { UIPositionManager uIPositionManager = viewControl.GetUIPositionManager(); uIPositionManager.switchFree(); uIPositionManager.SetPositionMemory(null); uIPositionManager.GetSMPos().setPosition(new LatLonZoom(0.0, 0.0, 0)); viewControl.GetSMViewerControl().ClearLayers(); viewControl.SetOptionsPanelVisibility(OptionsPanelVisibility.Nothing); viewControl.GetSourceMapInfoPanel().Configure(null); viewControl.GetSourceMapInfoPanel().Enabled = false; viewControl.GetTransparencyPanel().Configure(null, null); viewControl.GetTransparencyPanel().Enabled = false; viewControl.setDisplayedRegistration(null); viewControl.GetCachePackage().ClearSchedulers(); }
public void Activate() { try { UIPositionManager uIPositionManager = viewControl.GetUIPositionManager(); ViewerControlIfc sMViewerControl = viewControl.GetSMViewerControl(); bool flag = false; if (sourceMap.lastView is SourceMapRegistrationView) { try { SourceMapRegistrationView sourceMapRegistrationView = (SourceMapRegistrationView)sourceMap.lastView; if (sourceMapRegistrationView.locked) { if (sourceMap.ReadyToLock()) { SetupLockedView(); uIPositionManager.GetVEPos() .setPosition(sourceMapRegistrationView.GetReferenceMapView()); flag = true; } } else { SetupUnlockedView(); uIPositionManager.GetSMPos().setPosition(sourceMapRegistrationView.GetSourceMapView()); uIPositionManager.GetVEPos().setPosition(sourceMapRegistrationView.GetReferenceMapView()); flag = true; } viewControl.SetVEMapStyle(sourceMapRegistrationView.GetReferenceMapView().style); } catch (CorrespondencesAreSingularException) { } catch (InsufficientCorrespondencesException) { } } if (!flag) { SetupUnlockedView(); uIPositionManager.GetSMPos().setPosition(new ContinuousCoordinateSystem().GetDefaultView()); uIPositionManager.GetVEPos().setPosition(DefaultReferenceMapPosition(drv)); } uIPositionManager.SetPositionMemory(sourceMap); viewControl.SetOptionsPanelVisibility(OptionsPanelVisibility.SourceMapOptions); viewControl.GetSourceMapInfoPanel().Configure(sourceMap); viewControl.GetSourceMapInfoPanel().Enabled = true; viewControl.GetTransparencyPanel().Configure(sourceMap, sMViewerControl); viewControl.GetTransparencyPanel().Enabled = true; viewControl.GetSMViewerControl().SetSnapViewStore(new SourceSnapView(this)); viewControl.GetVEViewerControl().SetSnapViewStore(new RefSnapView(this)); uIPositionManager.PositionUpdated(); } catch (Exception) { Dispose(); throw; } }