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