To return the geometry you should import Microsoft.SqlServer.Types from Nuget and SqlServerSpatial140.dll from C:\Windows\System32
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Catalog;
using ESRI.ArcGIS.CatalogUI;
using ESRI.ArcGIS.Desktop.AddIns;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Framework;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
using Microsoft.SqlServer.Types;
namespace Test.Addin.ArcCommands
{
class SelectFeatureTool : ESRI.ArcGIS.Desktop.AddIns.Tool
{
protected override void OnMouseDown(MouseEventArgs arg)
{
IMxDocument mxDocument = ArcMap.Application.Document as IMxDocument;
IActiveView activeView = mxDocument.ActiveView;
IMap map = mxDocument.FocusMap;
ILayer layer = map.get_Layer(0); //Get 1st Layer
IFeatureLayer featureLayer = (IFeatureLayer) layer;
IPoint identifyPoint = activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y);
ESRI.ArcGIS.Carto.IIdentify identifyLayer = (IIdentify)layer;
IArray array = identifyLayer.Identify(identifyPoint);
int oid = -1;
if (array != null)
{
object obj = array.get_Element(0);
IFeatureIdentifyObj fobj = obj as IFeatureIdentifyObj;
IRowIdentifyObject irow = fobj as IRowIdentifyObject;
IFeature feature = irow.Row as IFeature;
oid = feature.OID;
}
HighlightClickedFeature(featureLayer, oid, activeView);
}