ComponentFactory.Krypton.Ribbon.PaletteRibbonContextBack.CheckForContextColor C# (CSharp) Method

CheckForContextColor() private method

private CheckForContextColor ( PaletteState state ) : Color
state PaletteState
return Color
        private Color CheckForContextColor(PaletteState state)
        {
            // We need an associated ribbon tab
            if (_ribbon != null)
            {
                // Does the ribbon tab have a context setting?
                KryptonRibbonTab selectedTab = _ribbon.SelectedTab;
                if (!string.IsNullOrEmpty(selectedTab.ContextName))
                {
                    // Find the context definition for this context
                    KryptonRibbonContext ribbonContext = _ribbon.RibbonContexts[selectedTab.ContextName];

                    // Should always work, but you never know!
                    if (ribbonContext != null)
                        return ribbonContext.ContextColor;
                }
            }

            return Color.Empty;
        }