Esempio n. 1
0
 private ArcmapPick LazyLoadPickTool()
 {
     if (_pick == null)
     {
         _pick = new ArcmapPick(_pickLayers, ArcmapUtils.GetFocusMap(), 10);
     }
     return(_pick);
 }
Esempio n. 2
0
 /// <summary>
 /// This event is called, when the user released the mouse button in ArcMap.
 /// </summary>
 /// <param name="arg">Event arguments</param>
 protected override void OnMouseUp(MouseEventArgs arg)
 {
     try
     {
         ArcmapPick          pick            = LazyLoadPickTool();
         ArcmapPickCandidate pickedCandidate = pick.OnMouseUp(arg.X, arg.Y);
         if (pickedCandidate != null)
         {
             ArcmapUtils.FlashFeature(pickedCandidate.Feature, ArcmapUtils.FocusMapToScreenDisplay(pick.FocusMap));
             GeometrySpyViewModel viewModel = new GeometrySpyViewModel(pickedCandidate.Feature);
             GeometrySpyView      form      = new GeometrySpyView();
             form.SetDataContext(viewModel);
             WindowsUtils.MakeModelessDialogParentOf(form, new IntPtr(ArcMap.Application.hWnd));
             form.Show();
         }
     }
     catch (Exception)
     {
         // Don't let the exeption escape to arcgis.
         ResetPickTool();
     }
     ArcmapUtils.InvalidateMap(ArcmapUtils.GetFocusMap());
 }
Esempio n. 3
0
 private void ResetPickTool()
 {
     _pick = null;
 }