ArcMapAddinCoordinateConversion.PointTool.GetMapPoint C# (CSharp) Method

GetMapPoint() private method

private GetMapPoint ( int X, int Y ) : IPoint
X int
Y int
return IPoint
        private IPoint GetMapPoint(int X, int Y)
        {
            //Get the active view from the ArcMap static class.
            IActiveView activeView = ArcMap.Document.FocusMap as IActiveView;

            var point = activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y) as IPoint;

            // always use WGS84
            var sr = GetSR();

            if (sr != null)
            {
                point.Project(sr);
            }

            return point;
        }