예제 #1
0
        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));
        }
예제 #2
0
        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);
        }
예제 #3
0
        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 + ".");
        }
예제 #4
0
        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 + ".");
        }