ArcMapAddinDistanceAndDirection.ViewModels.TabBaseViewModel.SetToolActiveInToolBar C# (CSharp) Method

SetToolActiveInToolBar() public method

Method to set the map tool as the active tool for the map
public SetToolActiveInToolBar ( ESRI application, System toolName ) : void
application ESRI
toolName System
return void
        public void SetToolActiveInToolBar(ESRI.ArcGIS.Framework.IApplication application, System.String toolName)
        {
            ESRI.ArcGIS.Framework.ICommandBars commandBars = application.Document.CommandBars;
            ESRI.ArcGIS.esriSystem.UID commandID = new ESRI.ArcGIS.esriSystem.UIDClass();
            commandID.Value = toolName;
            ESRI.ArcGIS.Framework.ICommandItem commandItem = commandBars.Find(commandID, false, false);

            if (commandItem != null)
                application.CurrentTool = commandItem;
        }
        #endregion