using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Framework;
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.ADF;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geometry;
namespace ArcMapAddin8
{
public class Button1 : ESRI.ArcGIS.Desktop.AddIns.Button
{
public Button1()
{
}
protected override void OnClick()
{
GetCommand(ArcMap.Application.Document as IMxDocument,);
//
// TODO: Sample code showing how to access button host
//
ArcMap.Application.CurrentTool = null;
}
#region "Get Command by Name"
public ICommandItem GetCommand(IApplication application, System.String commandName)
{
ICommandBars commandBars = application.Document.CommandBars;
ESRI.ArcGIS.esriSystem.UID commandID = new ESRI.ArcGIS.esriSystem.UIDClass();
commandID.Value = "esriEditor.ReshapeFeatureTool";
return commandBars.Find(commandID, false, false);
}
#endregion
protected override void OnUpdate()
{
Enabled = ArcMap.Application != null;
}
}
}