using ArcGIS.Core.CIM;
using ArcGIS.Core.Data;
using ArcGIS.Core.Geometry;
using ArcGIS.Desktop.Catalog;
using ArcGIS.Desktop.Core;
using ArcGIS.Desktop.Editing;
using ArcGIS.Desktop.Extensions;
using ArcGIS.Desktop.Framework;
using ArcGIS.Desktop.Framework.Contracts;
using ArcGIS.Desktop.Framework.Dialogs;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.KnowledgeGraph;
using ArcGIS.Desktop.Layouts;
using ArcGIS.Desktop.Mapping;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SketchAndConstructionTools
{
  internal class MultipointSelection : MapTool
  {
    public MultipointSelection()
    {
      IsSketchTool = true;
      SketchType = SketchGeometryType.Multipoint;
      SketchOutputMode = SketchOutputMode.Map;
    }

    protected override Task OnToolActivateAsync(bool active)
    {
      return base.OnToolActivateAsync(active);
    }

    protected override Task<bool> OnSketchCompleteAsync(Geometry geometry)
    {
      return QueuedTask.Run(async () =>
      {
        MapView.Active.SelectFeatures(geometry);
        return true;
      }
      );
    }
    protected override Task<bool> OnSketchModifiedAsync()
    {
      return QueuedTask.Run(async () =>
      {
        var sketch = await GetCurrentSketchAsync();

        SketchTip = $"Point count {sketch.PointCount}";
        return true;

      });
    }
  }
}
