Exemplo n.º 1
0
 public override void OnMouseUp(int int_0, int int_1, int int_2, int int_3)
 {
     if (this.istretchLineFeedback_0 != null)
     {
         IPolyline polyline = this.istretchLineFeedback_0.Stop();
         this.istretchLineFeedback_0 = null;
         IWorkspaceEdit workspace = (this.ifeature_0.Class as IDataset).Workspace as IWorkspaceEdit;
         workspace.StartEditOperation();
         try
         {
             if ((this.ifeature_0.Shape as IZAware).ZAware)
             {
                 (polyline as IZAware).ZAware = true;
                 (polyline as IZ).SetConstantZ((this.ifeature_0.Shape as IZ).ZMax);
             }
             this.ifeature_0.Shape = polyline;
             this.ifeature_0.Store();
         }
         catch (Exception exception)
         {
             MessageBox.Show(exception.ToString());
         }
         workspace.StopEditOperation();
         _context.ActiveView.Refresh();
     }
 }
Exemplo n.º 2
0
 public override void OnMouseDown(int int_0, int int_1, int int_2, int int_3)
 {
     if (int_0 == 1)
     {
         IPoint mapPoint = _context.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(int_2, int_3);
         this.ifeature_0 = this.FindFeature(mapPoint);
         if (this.ifeature_0 != null)
         {
             IPolyline shapeCopy = this.ifeature_0.ShapeCopy as IPolyline;
             ILine     lineClass = new Line();
             lineClass.PutCoords(mapPoint, shapeCopy.FromPoint);
             double length = lineClass.Length;
             lineClass.PutCoords(mapPoint, shapeCopy.ToPoint);
             double num = lineClass.Length;
             this.istretchLineFeedback_0 = new StretchLineFeedback()
             {
                 Display = _context.ActiveView.ScreenDisplay
             };
             this.istretchLineFeedback_0.Start(shapeCopy, mapPoint);
             if (length <= num)
             {
                 this.istretchLineFeedback_0.Anchor = shapeCopy.FromPoint;
             }
             else
             {
                 this.istretchLineFeedback_0.Anchor = shapeCopy.ToPoint;
             }
         }
     }
 }