Example #1
0
        protected override void  OnMouseDown(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg)
        {
            try
            {
                dlg = gpExtension.elevationDlg;
                if (dlg == null)
                {
                    return;
                }

                IDisplayTransformation displayTransformation = view.ScreenDisplay.DisplayTransformation;
                //the clicked point in map crs:
                IPoint mapPoint = displayTransformation.ToMapPoint(arg.X, arg.Y);

                //Get the polyline object from the users mouse clicks
                polyline = geopuntHelper.GetPolylineFromMouseClicks(view);

                dlg.getData(polyline);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " : " + ex.StackTrace);
            }
            finally
            {
                base.OnMouseDown(arg);
            }
        }
 protected override void OnClick()
 {
     try
     {
         if (view.FocusMap.SpatialReference == null)
         {
             view.FocusMap.SpatialReference = geopuntHelper.lam72;
         }
         if (elevationDlg != null)
         {
             if (elevationDlg.IsDisposed)
             {
                 elevationDlg = null;
             }
             else
             {
                 if (!elevationDlg.Visible) elevationDlg.Show();
                 elevationDlg.WindowState = FormWindowState.Normal;
                 elevationDlg.Focus();
                 return;
             }
         }
         elevationDlg = new elevationForm();
         gpExtension.elevationDlg = elevationDlg;
         elevationDlg.Show();
         elevationDlg.WindowState = FormWindowState.Normal;
         elevationDlg.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + " : " + ex.StackTrace);
     }
 }
        protected override void OnMouseDown(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg)
        {
            try
            {
                dlg = gpExtension.elevationDlg;
                if (dlg == null) return;

                IDisplayTransformation displayTransformation = view.ScreenDisplay.DisplayTransformation;
                //the clicked point in map crs:
                IPoint mapPoint = displayTransformation.ToMapPoint(arg.X, arg.Y);

                //Get the polyline object from the users mouse clicks
                polyline = geopuntHelper.GetPolylineFromMouseClicks(view);

                dlg.getData(polyline);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " : " + ex.StackTrace);
            }
            finally
            {
                base.OnMouseDown(arg);
            }
        }
Example #4
0
 protected override void OnClick()
 {
     try
     {
         if (view.FocusMap.SpatialReference == null)
         {
             view.FocusMap.SpatialReference = geopuntHelper.lam72;
         }
         if (elevationDlg != null)
         {
             if (elevationDlg.IsDisposed)
             {
                 elevationDlg = null;
             }
             else
             {
                 if (!elevationDlg.Visible)
                 {
                     elevationDlg.Show();
                 }
                 elevationDlg.WindowState = FormWindowState.Normal;
                 elevationDlg.Focus();
                 return;
             }
         }
         elevationDlg             = new elevationForm();
         gpExtension.elevationDlg = elevationDlg;
         elevationDlg.Show();
         elevationDlg.WindowState = FormWindowState.Normal;
         elevationDlg.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + " : " + ex.StackTrace);
     }
 }