Пример #1
0
        public static void PropagateHEXColourValues(KryptonListBox hexValues, bool useUppercase)
        {
            AllMergedColourSettingsManager colourSettingsManager = new AllMergedColourSettingsManager();

            if (useUppercase)
            {
                hexValues.Items.Add($"Base Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetBaseColour()) }");

                hexValues.Items.Add($"Darkest Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetDarkColour()) }");

                hexValues.Items.Add($"Medium Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetMediumColour()) }");

                hexValues.Items.Add($"Light Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLightColour()) }");

                hexValues.Items.Add($"Lightest Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLightestColour()) }");

                hexValues.Items.Add($"Border Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetBorderColour()) }");

                hexValues.Items.Add($"Alternative Normal Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetAlternativeNormalTextColour()) }");

                hexValues.Items.Add($"Disabled Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetDisabledTextColour()) }");

                hexValues.Items.Add($"Normal Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetNormalTextColour()) }");

                hexValues.Items.Add($"Focused Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetFocusedTextColour()) }");

                hexValues.Items.Add($"Pressed Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetPressedTextColour()) }");

                hexValues.Items.Add($"Ribbon Tab Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetRibbonTabTextColour()) }");

                hexValues.Items.Add($"Disabled Control Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetDisabledControlColour()) }");

                hexValues.Items.Add($"Link Disabled Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLinkDisabledColour()) }");

                hexValues.Items.Add($"Link Focused Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLinkFocusedColour()) }");

                hexValues.Items.Add($"Link Normal Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLinkNormalColour()) }");

                hexValues.Items.Add($"Link Hover Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLinkHoverColour()) }");

                hexValues.Items.Add($"Link Visited Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLinkVisitedColour()) }");

                hexValues.Items.Add($"Menu Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetMenuTextColour()) }");

                hexValues.Items.Add($"Status Strip Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetStatusStripTextColour()) }");

                hexValues.Items.Add($"Custom Colour One Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomColourOne()) }");

                hexValues.Items.Add($"Custom Colour Two Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomColourTwo()) }");

                hexValues.Items.Add($"Custom Colour Three Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomColourThree()) }");

                hexValues.Items.Add($"Custom Colour Four Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomColourFour()) }");

                hexValues.Items.Add($"Custom Colour Five Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomColourFive()) }");

                hexValues.Items.Add($"Custom Text Colour One Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomTextColourOne()) }");

                hexValues.Items.Add($"Custom Text Colour Two Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomTextColourTwo()) }");

                hexValues.Items.Add($"Custom Text Colour Three Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomTextColourThree()) }");

                hexValues.Items.Add($"Custom Text Colour Four Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomTextColourFour()) }");

                hexValues.Items.Add($"Custom Text Colour Five Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomTextColourFive()) }");
            }
            else
            {
                hexValues.Items.Add($"Base Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetBaseColour()).ToUpper() }");

                hexValues.Items.Add($"Darkest Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetDarkColour()).ToUpper() }");

                hexValues.Items.Add($"Medium Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetMediumColour()).ToUpper() }");

                hexValues.Items.Add($"Light Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLightColour()).ToUpper() }");

                hexValues.Items.Add($"Lightest Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLightestColour()).ToUpper() }");

                hexValues.Items.Add($"Border Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetBorderColour()).ToUpper() }");

                hexValues.Items.Add($"Alternative Normal Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetAlternativeNormalTextColour()).ToUpper() }");

                hexValues.Items.Add($"Disabled Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetDisabledTextColour()).ToUpper() }");

                hexValues.Items.Add($"Normal Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetNormalTextColour()).ToUpper() }");

                hexValues.Items.Add($"Focused Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetFocusedTextColour()).ToUpper() }");

                hexValues.Items.Add($"Pressed Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetPressedTextColour()).ToUpper() }");

                hexValues.Items.Add($"Ribbon Tab Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetRibbonTabTextColour()).ToUpper() }");

                hexValues.Items.Add($"Disabled Control Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetDisabledControlColour()).ToUpper() }");

                hexValues.Items.Add($"Link Disabled Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLinkDisabledColour()).ToUpper() }");

                hexValues.Items.Add($"Link Focused Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLinkFocusedColour()).ToUpper() }");

                hexValues.Items.Add($"Link Normal Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLinkNormalColour()).ToUpper() }");

                hexValues.Items.Add($"Link Hover Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLinkHoverColour()).ToUpper() }");

                hexValues.Items.Add($"Link Visited Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetLinkVisitedColour()).ToUpper() }");

                hexValues.Items.Add($"Menu Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetMenuTextColour()).ToUpper() }");

                hexValues.Items.Add($"Status Strip Text Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetStatusStripTextColour()).ToUpper() }");

                hexValues.Items.Add($"Custom Colour One Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomColourOne()).ToUpper() }");

                hexValues.Items.Add($"Custom Colour Two Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomColourTwo()).ToUpper() }");

                hexValues.Items.Add($"Custom Colour Three Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomColourThree()).ToUpper() }");

                hexValues.Items.Add($"Custom Colour Four Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomColourFour()).ToUpper() }");

                hexValues.Items.Add($"Custom Colour Five Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomColourFive()).ToUpper() }");

                hexValues.Items.Add($"Custom Text Colour One Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomTextColourOne()).ToUpper() }");

                hexValues.Items.Add($"Custom Text Colour Two Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomTextColourTwo()).ToUpper() }");

                hexValues.Items.Add($"Custom Text Colour Three Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomTextColourThree()).ToUpper() }");

                hexValues.Items.Add($"Custom Text Colour Four Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomTextColourFour()).ToUpper() }");

                hexValues.Items.Add($"Custom Text Colour Five Colour: { ColorTranslator.ToHtml(colourSettingsManager.GetCustomTextColourFive()).ToUpper() }");
            }
        }
Пример #2
0
        /// <summary>
        /// Retrieves the selected colour.
        /// </summary>
        /// <param name="colourType">Type of the colour.</param>
        /// <returns>The chosen colour.</returns>
        public static Color RetrieveSelectedColour(AllAvailableColourTypes colourType)
        {
            Color tempColour = Color.FromArgb(0, 0, 0, 0);

            AllMergedColourSettingsManager colourSettingsManager = new AllMergedColourSettingsManager();

            try
            {
                switch (colourType)
                {
                case AllAvailableColourTypes.ALTERNATIVENORMALTEXTCOLOUR:
                    tempColour = colourSettingsManager.GetAlternativeNormalTextColour();
                    break;

                case AllAvailableColourTypes.BASECOLOUR:
                    tempColour = colourSettingsManager.GetBaseColour();
                    break;

                case AllAvailableColourTypes.BORDERCOLOUR:
                    tempColour = colourSettingsManager.GetBorderColour();
                    break;

                case AllAvailableColourTypes.CUSTOMCOLOURONE:
                    tempColour = colourSettingsManager.GetCustomColourOne();
                    break;

                case AllAvailableColourTypes.CUSTOMCOLOURTWO:
                    tempColour = colourSettingsManager.GetCustomColourTwo();
                    break;

                case AllAvailableColourTypes.CUSTOMCOLOURTHREE:
                    tempColour = colourSettingsManager.GetCustomColourThree();
                    break;

                case AllAvailableColourTypes.CUSTOMCOLOURFOUR:
                    tempColour = colourSettingsManager.GetCustomColourFour();
                    break;

                case AllAvailableColourTypes.CUSTOMCOLOURFIVE:
                    tempColour = colourSettingsManager.GetCustomColourFive();
                    break;

                case AllAvailableColourTypes.CUSTOMCOLOURSIX:
                    tempColour = colourSettingsManager.GetCustomColourSix();
                    break;

                case AllAvailableColourTypes.CUSTOMTEXTCOLOURONE:
                    tempColour = colourSettingsManager.GetCustomTextColourOne();
                    break;

                case AllAvailableColourTypes.CUSTOMTEXTCOLOURTWO:
                    tempColour = colourSettingsManager.GetCustomTextColourTwo();
                    break;

                case AllAvailableColourTypes.CUSTOMTEXTCOLOURTHREE:
                    tempColour = colourSettingsManager.GetCustomTextColourThree();
                    break;

                case AllAvailableColourTypes.CUSTOMTEXTCOLOURFOUR:
                    tempColour = colourSettingsManager.GetCustomTextColourFour();
                    break;

                case AllAvailableColourTypes.CUSTOMTEXTCOLOURFIVE:
                    tempColour = colourSettingsManager.GetCustomTextColourFive();
                    break;

                case AllAvailableColourTypes.CUSTOMTEXTCOLOURSIX:
                    tempColour = colourSettingsManager.GetCustomTextColourSix();
                    break;

                case AllAvailableColourTypes.DARKESTCOLOUR:
                    tempColour = colourSettingsManager.GetDarkColour();
                    break;

                case AllAvailableColourTypes.DISABLEDCONTROLCOLOUR:
                    tempColour = colourSettingsManager.GetDisabledControlColour();
                    break;

                case AllAvailableColourTypes.DISABLEDTEXTCOLOUR:
                    tempColour = colourSettingsManager.GetDisabledTextColour();
                    break;

                case AllAvailableColourTypes.FOCUSEDTEXTCOLOUR:
                    tempColour = colourSettingsManager.GetFocusedTextColour();
                    break;

                case AllAvailableColourTypes.LIGHTCOLOUR:
                    tempColour = colourSettingsManager.GetLightColour();
                    break;

                case AllAvailableColourTypes.LIGHTESTCOLOUR:
                    tempColour = colourSettingsManager.GetLightestColour();
                    break;

                case AllAvailableColourTypes.LINKDISABLEDCOLOUR:
                    tempColour = colourSettingsManager.GetLinkDisabledColour();
                    break;

                case AllAvailableColourTypes.LINKHOVERCOLOUR:
                    tempColour = colourSettingsManager.GetLinkHoverColour();
                    break;

                case AllAvailableColourTypes.LINKNORMALCOLOUR:
                    tempColour = colourSettingsManager.GetLinkNormalColour();
                    break;

                case AllAvailableColourTypes.LINKVISITEDCOLOUR:
                    tempColour = colourSettingsManager.GetLinkVisitedColour();
                    break;

                case AllAvailableColourTypes.MEDIUMCOLOUR:
                    tempColour = colourSettingsManager.GetMediumColour();
                    break;

                case AllAvailableColourTypes.MENUTEXTCOLOUR:
                    tempColour = colourSettingsManager.GetMenuTextColour();
                    break;

                case AllAvailableColourTypes.NORMALTEXTCOLOUR:
                    tempColour = colourSettingsManager.GetNormalTextColour();
                    break;

                case AllAvailableColourTypes.PRESSEDTEXTCOLOUR:
                    tempColour = colourSettingsManager.GetPressedTextColour();
                    break;

                case AllAvailableColourTypes.STATUSTEXTCOLOUR:
                    tempColour = colourSettingsManager.GetStatusStripTextColour();
                    break;

                default:
                    tempColour = Color.FromArgb(0, 0, 0, 0);
                    break;
                }
            }
            catch (Exception exc)
            {
                KryptonMessageBox.Show($"An unexpected error has occurred: { exc.Message }", "Retrieving Settings Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);

                tempColour = Color.FromArgb(0, 0, 0, 0);
            }

            return(tempColour);
        }
        private void PropagateColourSettingsArray()
        {
            _colourSettingsArray = new ArrayList();

            _colourSettingsArray.Add($"Base Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetBaseColour()) }");

            _colourSettingsArray.Add($"Dark Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetDarkColour()) }");

            _colourSettingsArray.Add($"Middle Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetMediumColour()) }");

            _colourSettingsArray.Add($"Light Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetLightColour()) }");

            _colourSettingsArray.Add($"Lightest Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetLightestColour()) }");

            _colourSettingsArray.Add($"Border Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetBorderColour()) }");

            _colourSettingsArray.Add($"Disabled Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetDisabledControlColour()) }");

            _colourSettingsArray.Add($"Alternative Normal Text Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetAlternativeNormalTextColour()) }");

            _colourSettingsArray.Add($"Disabled Text Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetDisabledTextColour()) }");

            _colourSettingsArray.Add($"Normal Text Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetNormalTextColour()) }");

            _colourSettingsArray.Add($"Focused Text Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetFocusedTextColour()) }");

            _colourSettingsArray.Add($"Pressed Text Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetPressedTextColour()) }");

            _colourSettingsArray.Add($"Link Disabled Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetLinkDisabledColour()) }");

            _colourSettingsArray.Add($"Link Normal Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetLinkNormalColour()) }");

            _colourSettingsArray.Add($"Link Hover Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetLinkHoverColour()) }");

            _colourSettingsArray.Add($"Link Visited Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetLinkVisitedColour()) }");

            _colourSettingsArray.Add($"Custom Colour One: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomColourOne()) }");

            _colourSettingsArray.Add($"Custom Colour Two: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomColourTwo()) }");

            _colourSettingsArray.Add($"Custom Colour Three: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomColourThree()) }");

            _colourSettingsArray.Add($"Custom Colour Four: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomColourFour()) }");

            _colourSettingsArray.Add($"Custom Colour Five: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomColourFive()) }");

            _colourSettingsArray.Add($"Custom Colour Six: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomColourSix()) }");

            _colourSettingsArray.Add($"Custom Text Colour One: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomTextColourOne()) }");

            _colourSettingsArray.Add($"Custom Text Colour Two: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomTextColourTwo()) }");

            _colourSettingsArray.Add($"Custom Text Colour Three: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomTextColourThree()) }");

            _colourSettingsArray.Add($"Custom Text Colour Four: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomTextColourFour()) }");

            _colourSettingsArray.Add($"Custom Text Colour Five: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomTextColourFive()) }");

            _colourSettingsArray.Add($"Custom Text Colour Six: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetCustomTextColourSix()) }");

            _colourSettingsArray.Add($"Menu Text Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetMenuTextColour()) }");

            _colourSettingsArray.Add($"Status Text Colour: { ColourUtilities.FormatColourRGBString(_colourSettingsManager.GetStatusStripTextColour()) }");
        }