void ComponentManager_ItemExecuted(object sender, Autodesk.Internal.Windows.RibbonItemExecutedEventArgs e) { if (e.Item == null) { return; } // 获取命令Id var id = UIFramework.ControlHelper.GetCommandId(e.Item); Debug.WriteLine(string.Format("Text: {0} ID: {1}", e.Item.Text, id)); }
static void OnItemExecuted( object sender, Autodesk.Internal.Windows .RibbonItemExecutedEventArgs e) { string s = (null == sender) ? "<nul>" : sender.ToString(); Autodesk.Windows.RibbonItem parent = e.Parent; Debug.Print( "OnItemExecuted: {0} '{1}' in '{2}' cookie {3}", s, parent.AutomationName, e.Item.AutomationName, e.Item.Cookie); }
private void ComponentManager_ItemExecuted(object sender, Autodesk.Internal.Windows.RibbonItemExecutedEventArgs e) { // ((e.Item as RibbonButton).CommandHandler). // var macro = ((RibbonCommandButton)((Autodesk.Windows.RibbonCommandItem)e.Item).CommandHandler).Macro; if (e.Item != null) { _buttonName = e.Item.AutomationName; } else { _buttonName = string.Empty; } _tabName = Autodesk.Windows.ComponentManager.Ribbon != null ? Autodesk.Windows.ComponentManager.Ribbon.ActiveTab.Title : string.Empty; // MessageBox.Show("You have clicked " + e.Item.AutomationName + "."); }
private void ComponentManager_ItemExecuted(object sender, Autodesk.Internal.Windows.RibbonItemExecutedEventArgs e) { // ((e.Item as RibbonButton).CommandHandler). // var macro = ((RibbonCommandButton)((Autodesk.Windows.RibbonCommandItem)e.Item).CommandHandler).Macro; if (e.Item != null) { _buttonName = e.Item.AutomationName; } else { _buttonName = string.Empty; } _tabName = Autodesk.Windows.ComponentManager.Ribbon != null ? Autodesk.Windows.ComponentManager.Ribbon.Name : string.Empty; string temp = _tabName.ToLower().Replace(".cuix", "").Replace("b - civil", "").Replace("b-civil", "").Replace("_", "").Trim(); _tabName = string.IsNullOrEmpty(temp) ? "New Zealand" : ((temp == "au") ? "Australia" : "Singapore"); //22-Oct-2018 // _tabName = Autodesk.Windows.ComponentManager.Ribbon != null ? Autodesk.Windows.ComponentManager.Ribbon.ActiveTab.Title : string.Empty; // MessageBox.Show("You have clicked " + e.Item.AutomationName + "."); }