ArcMapAddinVisibility.ViewModels.LOSBaseViewModel.IsValidPoint C# (CSharp) Method

IsValidPoint() private method

Method to check to see point is withing the currently selected surface returns true if there is no surface selected or point is contained by layer AOI returns false if the point is not contained in the layer AOI
private IsValidPoint ( IPoint point, bool showPopup = false ) : bool
point IPoint IPoint to validate
showPopup bool boolean to show popup message or not
return bool
        internal bool IsValidPoint(IPoint point, bool showPopup = false)
        {
            var validPoint = true;

            if (!string.IsNullOrWhiteSpace(SelectedSurfaceName) && ArcMap.Document != null && ArcMap.Document.FocusMap != null)
            {
                validPoint = IsPointWithinExtent(point, GetLayerFromMapByName(ArcMap.Document.FocusMap, SelectedSurfaceName).AreaOfInterest);

                if (validPoint == false && showPopup)
                    System.Windows.Forms.MessageBox.Show(VisibilityLibrary.Properties.Resources.MsgOutOfAOI);
            }

            return validPoint;
        }