ArcMapAddinDistanceAndDirection.ViewModels.TabBaseViewModel.SetToolActiveInToolBar C# (CSharp) Метод

SetToolActiveInToolBar() публичный Метод

Method to set the map tool as the active tool for the map
public SetToolActiveInToolBar ( ESRI application, System toolName ) : void
application ESRI
toolName System
Результат 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