/// <summary>
        /// Merges all colour settings together.
        /// </summary>
        /// <param name="usePrompt">if set to <c>true</c> [use prompt].</param>
        public static void MergeAllColourSettings(bool usePrompt = false)
        {
            #region Variables
            BasicColourSettingsManager basicPaletteColourManager = new BasicColourSettingsManager();

            CustomColourSettingsManager customPaletteColourManager = new CustomColourSettingsManager();

            CustomTextColourSettingsManager customPaletteTextColourManager = new CustomTextColourSettingsManager();

            LinkTextColourSettingsManager linkTextPaletteColourManager = new LinkTextColourSettingsManager();

            MiscellaneousColourSettingsManager miscellaneousPaletteColourManager = new MiscellaneousColourSettingsManager();

            StandardControlTextColourSettingsManager standardControlTextColourSettingsManager = new StandardControlTextColourSettingsManager();

            TextColourSettingsManager textPaletteColourManager = new TextColourSettingsManager();

            AllMergedColourSettingsManager colourSettingsManager = new AllMergedColourSettingsManager();
            #endregion

            try
            {
                if (BasicColourSettingsManager.AreBasicPaletteColoursEmpty() || CustomColourSettingsManager.AreCustomPaletteColoursEmpty() || CustomTextColourSettingsManager.AreCustomPaletteTextColoursEmpty() || LinkTextColourSettingsManager.AreLinkTextPaletteColoursEmpty() || MiscellaneousColourSettingsManager.AreMiscellaneousPaletteColoursEmpty() || StandardControlTextColourSettingsManager.AreStandardControlTextColoursEmpty() || TextColourSettingsManager.AreTextPaletteColoursEmpty())
                {
                    KryptonMessageBox.Show("There are no colours to merge.", "Undefined Colours", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    if (usePrompt)
                    {
                        DialogResult result = KryptonMessageBox.Show("Do you want to merge all the colour settings together?", "Confirm Merge", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                        if (result == DialogResult.Yes)
                        {
                            colourSettingsManager.SetAlternativeNormalTextColour(textPaletteColourManager.GetAlternativeNormalTextColour());

                            colourSettingsManager.SetBaseColour(basicPaletteColourManager.GetBaseColour());

                            colourSettingsManager.SetBorderColour(miscellaneousPaletteColourManager.GetBorderColour());

                            colourSettingsManager.SetCustomColourOne(customPaletteColourManager.GetCustomColourOne());

                            colourSettingsManager.SetCustomColourTwo(customPaletteColourManager.GetCustomColourTwo());

                            colourSettingsManager.SetCustomColourThree(customPaletteColourManager.GetCustomColourThree());

                            colourSettingsManager.SetCustomColourFour(customPaletteColourManager.GetCustomColourFour());

                            colourSettingsManager.SetCustomColourFive(customPaletteColourManager.GetCustomColourFive());

                            colourSettingsManager.SetCustomColourSix(customPaletteColourManager.GetCustomColourSix());

                            colourSettingsManager.SetCustomTextColourOne(customPaletteTextColourManager.GetCustomTextColourOne());

                            colourSettingsManager.SetCustomTextColourTwo(customPaletteTextColourManager.GetCustomTextColourTwo());

                            colourSettingsManager.SetCustomTextColourThree(customPaletteTextColourManager.GetCustomTextColourThree());

                            colourSettingsManager.SetCustomTextColourFour(customPaletteTextColourManager.GetCustomTextColourFour());

                            colourSettingsManager.SetCustomTextColourFive(customPaletteTextColourManager.GetCustomTextColourFive());

                            colourSettingsManager.SetCustomTextColourSix(customPaletteTextColourManager.GetCustomTextColourSix());

                            colourSettingsManager.SetDarkColour(basicPaletteColourManager.GetDarkColour());

                            colourSettingsManager.SetDisabledControlColour(miscellaneousPaletteColourManager.GetDisabledControlColour());

                            colourSettingsManager.SetDisabledTextColour(textPaletteColourManager.GetDisabledTextColour());

                            colourSettingsManager.SetFocusedTextColour(textPaletteColourManager.GetFocusedTextColour());

                            colourSettingsManager.SetLightColour(basicPaletteColourManager.GetLightColour());

                            colourSettingsManager.SetLightestColour(basicPaletteColourManager.GetLightestColour());

                            colourSettingsManager.SetLinkDisabledColour(linkTextPaletteColourManager.GetLinkDisabledColour());

                            colourSettingsManager.SetLinkFocusedColour(linkTextPaletteColourManager.GetLinkFocusedColour());

                            colourSettingsManager.SetLinkHoverColour(linkTextPaletteColourManager.GetLinkHoverColour());

                            colourSettingsManager.SetLinkNormalColour(linkTextPaletteColourManager.GetLinkNormalColour());

                            colourSettingsManager.SetLinkVisitedColour(linkTextPaletteColourManager.GetLinkVisitedColour());

                            colourSettingsManager.SetMediumColour(basicPaletteColourManager.GetMediumColour());

                            colourSettingsManager.SetMenuTextColour(standardControlTextColourSettingsManager.GetMenuTextColour());

                            colourSettingsManager.SetNormalTextColour(textPaletteColourManager.GetNormalTextColour());

                            colourSettingsManager.SetPressedTextColour(textPaletteColourManager.GetPressedTextColour());

                            colourSettingsManager.SetRibbonTabTextColour(standardControlTextColourSettingsManager.GetRibbonTabTextColour());

                            colourSettingsManager.SetStatusStripTextColour(standardControlTextColourSettingsManager.GetStatusStripTextColour());

                            colourSettingsManager.SaveAllMergedColourSettings(usePrompt);
                        }
                    }
                    else
                    {
                        colourSettingsManager.SetAlternativeNormalTextColour(textPaletteColourManager.GetAlternativeNormalTextColour());

                        colourSettingsManager.SetBaseColour(basicPaletteColourManager.GetBaseColour());

                        colourSettingsManager.SetBorderColour(miscellaneousPaletteColourManager.GetBorderColour());

                        colourSettingsManager.SetCustomColourOne(customPaletteColourManager.GetCustomColourOne());

                        colourSettingsManager.SetCustomColourTwo(customPaletteColourManager.GetCustomColourTwo());

                        colourSettingsManager.SetCustomColourThree(customPaletteColourManager.GetCustomColourThree());

                        colourSettingsManager.SetCustomColourFour(customPaletteColourManager.GetCustomColourFour());

                        colourSettingsManager.SetCustomColourFive(customPaletteColourManager.GetCustomColourFive());

                        colourSettingsManager.SetCustomTextColourOne(customPaletteTextColourManager.GetCustomTextColourOne());

                        colourSettingsManager.SetCustomTextColourTwo(customPaletteTextColourManager.GetCustomTextColourTwo());

                        colourSettingsManager.SetCustomTextColourThree(customPaletteTextColourManager.GetCustomTextColourThree());

                        colourSettingsManager.SetCustomTextColourFour(customPaletteTextColourManager.GetCustomTextColourFour());

                        colourSettingsManager.SetCustomTextColourFive(customPaletteTextColourManager.GetCustomTextColourFive());

                        colourSettingsManager.SetDarkColour(basicPaletteColourManager.GetDarkColour());

                        colourSettingsManager.SetDisabledControlColour(miscellaneousPaletteColourManager.GetDisabledControlColour());

                        colourSettingsManager.SetDisabledTextColour(textPaletteColourManager.GetDisabledTextColour());

                        colourSettingsManager.SetFocusedTextColour(textPaletteColourManager.GetFocusedTextColour());

                        colourSettingsManager.SetLightColour(basicPaletteColourManager.GetLightColour());

                        colourSettingsManager.SetLightestColour(basicPaletteColourManager.GetLightestColour());

                        colourSettingsManager.SetLinkDisabledColour(linkTextPaletteColourManager.GetLinkDisabledColour());

                        colourSettingsManager.SetLinkFocusedColour(linkTextPaletteColourManager.GetLinkFocusedColour());

                        colourSettingsManager.SetLinkHoverColour(linkTextPaletteColourManager.GetLinkHoverColour());

                        colourSettingsManager.SetLinkNormalColour(linkTextPaletteColourManager.GetLinkNormalColour());

                        colourSettingsManager.SetLinkVisitedColour(linkTextPaletteColourManager.GetLinkVisitedColour());

                        colourSettingsManager.SetMediumColour(basicPaletteColourManager.GetMediumColour());

                        colourSettingsManager.SetMenuTextColour(standardControlTextColourSettingsManager.GetMenuTextColour());

                        colourSettingsManager.SetNormalTextColour(textPaletteColourManager.GetNormalTextColour());

                        colourSettingsManager.SetPressedTextColour(textPaletteColourManager.GetPressedTextColour());

                        colourSettingsManager.SetRibbonTabTextColour(standardControlTextColourSettingsManager.GetRibbonTabTextColour());

                        colourSettingsManager.SetStatusStripTextColour(standardControlTextColourSettingsManager.GetStatusStripTextColour());

                        colourSettingsManager.SaveAllMergedColourSettings();
                    }
                }
            }
            catch (Exception exc)
            {
                ExceptionHandler.CaptureException(exc, icon: MessageBoxIcon.Error, methodSignature: Helpers.GetCurrentMethod());
            }
        }
Exemplo n.º 2
0
        public static void MergeAllColours()
        {
            #region Variables
            AllMergedColourSettingsManager allMergedColourSettingsManager = new AllMergedColourSettingsManager();

            BasicColourSettingsManager basicColourSettingsManager = new BasicColourSettingsManager();

            CustomColourSettingsManager customColourSettingsManager = new CustomColourSettingsManager();

            CustomTextColourSettingsManager customTextColourSettingsManager = new CustomTextColourSettingsManager();

            LinkTextColourSettingsManager linkTextColourSettingsManager = new LinkTextColourSettingsManager();

            MiscellaneousColourSettingsManager miscellaneousColourSettingsManager = new MiscellaneousColourSettingsManager();

            StandardControlTextColourSettingsManager standardControlTextColourSettingsManager = new StandardControlTextColourSettingsManager();

            TextColourSettingsManager textColourSettingsManager = new TextColourSettingsManager();
            #endregion

            try
            {
                #region Basic Colours
                if (!BasicColourSettingsManager.AreBasicPaletteColoursEmpty())
                {
                    allMergedColourSettingsManager.SetBaseColour(basicColourSettingsManager.GetBaseColour());

                    allMergedColourSettingsManager.SetDarkColour(basicColourSettingsManager.GetDarkColour());

                    allMergedColourSettingsManager.SetMediumColour(basicColourSettingsManager.GetMediumColour());

                    allMergedColourSettingsManager.SetLightColour(basicColourSettingsManager.GetLightColour());

                    allMergedColourSettingsManager.SetLightestColour(basicColourSettingsManager.GetLightestColour());
                }
                #endregion

                #region Custom Colours
                if (!CustomColourSettingsManager.AreCustomPaletteColoursEmpty())
                {
                    allMergedColourSettingsManager.SetCustomColourOne(customColourSettingsManager.GetCustomColourOne());

                    allMergedColourSettingsManager.SetCustomColourTwo(customColourSettingsManager.GetCustomColourTwo());

                    allMergedColourSettingsManager.SetCustomColourThree(customColourSettingsManager.GetCustomColourThree());

                    allMergedColourSettingsManager.SetCustomColourFour(customColourSettingsManager.GetCustomColourFour());

                    allMergedColourSettingsManager.SetCustomColourFive(customColourSettingsManager.GetCustomColourFive());

                    allMergedColourSettingsManager.SetCustomColourSix(customColourSettingsManager.GetCustomColourSix());
                }
                #endregion

                #region Custom Text Colours
                if (!CustomTextColourSettingsManager.AreCustomPaletteTextColoursEmpty())
                {
                    allMergedColourSettingsManager.SetCustomTextColourOne(customTextColourSettingsManager.GetCustomTextColourOne());

                    allMergedColourSettingsManager.SetCustomTextColourTwo(customTextColourSettingsManager.GetCustomTextColourTwo());

                    allMergedColourSettingsManager.SetCustomTextColourThree(customTextColourSettingsManager.GetCustomTextColourThree());

                    allMergedColourSettingsManager.SetCustomTextColourFour(customTextColourSettingsManager.GetCustomTextColourFour());

                    allMergedColourSettingsManager.SetCustomTextColourFive(customTextColourSettingsManager.GetCustomTextColourFive());

                    allMergedColourSettingsManager.SetCustomTextColourSix(customTextColourSettingsManager.GetCustomTextColourSix());
                }
                #endregion

                #region Link Colours
                allMergedColourSettingsManager.SetLinkDisabledColour(linkTextColourSettingsManager.GetLinkDisabledColour());

                allMergedColourSettingsManager.SetLinkFocusedColour(linkTextColourSettingsManager.GetLinkFocusedColour());

                allMergedColourSettingsManager.SetLinkHoverColour(linkTextColourSettingsManager.GetLinkHoverColour());

                allMergedColourSettingsManager.SetLinkNormalColour(linkTextColourSettingsManager.GetLinkNormalColour());

                allMergedColourSettingsManager.SetLinkVisitedColour(linkTextColourSettingsManager.GetLinkVisitedColour());
                #endregion

                allMergedColourSettingsManager.SaveAllMergedColourSettings();
            }
            catch (Exception exc)
            {
                ExceptionHandler.CaptureException(exc, icon: MessageBoxIcon.Error, methodSignature: Helpers.GetCurrentMethod());
            }
        }