Beispiel #1
0
        public ISnappingResult FullSnap(IPoint ipoint_0)
        {
            SnappingResult snappingResult = new SnappingResult()
            {
                X = ipoint_0.X,
                Y = ipoint_0.Y
            };

            return(snappingResult);
        }
Beispiel #2
0
        public ISnappingResult Snap(IPoint pPoint)
        {
            ISnappingResult snappingResult;

            if (this.Map != null)
            {
                IPoint      point         = null;
                IAppContext application   = ApplicationRef.AppContext;
                double      snapTolerance = application.Config.EngineSnapEnvironment.SnapTolerance;
                if (application.Config.EngineSnapEnvironment.SnapToleranceUnits ==
                    esriEngineSnapToleranceUnits.esriEngineSnapTolerancePixels)
                {
                    snapTolerance =
                        CommonHelper.ConvertPixelsToMapUnits(application.MapControl.ActiveView as IActiveView,
                                                             snapTolerance);
                }
                if (!this.SnapAll(pPoint, application, snapTolerance, out point))
                {
                    ApplicationRef.AppContext.SetToolTip("");
                    snappingResult = null;
                }
                else
                {
                    SnappingResult snappingResult1 = new SnappingResult()
                    {
                        X = point.X,
                        Y = point.Y
                    };
                    snappingResult = snappingResult1;
                }
            }
            else
            {
                snappingResult = null;
            }
            return(snappingResult);
        }