Пример #1
0
        public void UpdateKeys( WinFormsUtility.Commands.KeyCommandLauncher keyCommandLauncher )
        {
            foreach( Controls.Ribbon.Section section in Sections )
            {
                foreach( Controls.Ribbon.Item item in section.Items )
                {
                    Commands.CommandRibbonButtonItem buttonItem = item as Commands.CommandRibbonButtonItem;
                    Commands.CommandSemiDropDownRibbonButtonItem semiButtonItem = item as Commands.CommandSemiDropDownRibbonButtonItem;

                    if( buttonItem != null && buttonItem.Command != null )
                    {
                        string keyText = keyCommandLauncher.GetKeyText( buttonItem.Command );

                        if( keyText != null )
                        {
                            buttonItem.TooltipDescription += string.Format( " ({0})", keyText );
                        }
                    }

                    if( semiButtonItem != null && semiButtonItem.Command != null )
                    {
                        string keyText = keyCommandLauncher.GetKeyText( semiButtonItem.Command );

                        if( keyText != null )
                        {
                            semiButtonItem.TooltipDescription += string.Format( " ({0})", keyText );
                        }
                    }
                }
            }
        }