Ejemplo n.º 1
0
        public static void WriteRGBColoursToFile(string colourConfigurationFilePath)
        {
            AllMergedColourSettingsManager manager = new AllMergedColourSettingsManager();

            try
            {
                if (!File.Exists(colourConfigurationFilePath))
                {
                    File.Create(colourConfigurationFilePath);
                }

                StreamWriter writer = new StreamWriter(colourConfigurationFilePath);

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetAlternativeNormalTextColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetBaseColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetBorderColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourOne()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourTwo()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourThree()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourFour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourFive()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourSix()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourOne()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourTwo()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourThree()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourFour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourFive()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourSix()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetDarkColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetDisabledControlColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetDisabledTextColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetFocusedTextColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLightColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLightestColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLinkDisabledColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLinkFocusedColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLinkHoverColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLinkNormalColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLinkVisitedColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetMediumColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetMenuTextColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetNormalTextColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetPressedTextColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetRibbonTabTextColour()));

                writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetStatusStripTextColour()));

                writer.Flush();

                writer.Close();

                writer.Dispose();
            }
            catch (Exception exc)
            {
                ExceptionHandler.CaptureException(exc, icon: MessageBoxIcon.Error, methodSignature: MethodHelpers.GetCurrentMethod());
            }
        }
        /// <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());
            }
        }
        public void SaveSettings(bool useConfirmDialog = false)
        {
            _colourSettingsManager.ResetToDefaults();

            _colourSettingsManager.SaveAllMergedColourSettings(useConfirmDialog);

            try
            {
                if (BaseColour != null || DarkColour != null || MiddleColour != null || LightColour != null || LightestColour != null || BorderColourPreview != null || AlternativeNormalTextColourPreview != null || NormalTextColourPreview != null || DisabledTextColourPreview != null || FocusedTextColourPreview != null || PressedTextColourPreview != null || DisabledColourPreview != null || LinkNormalColourPreview != null || LinkHoverColourPreview != null || LinkVisitedColourPreview != null || CustomColourOne != null || CustomColourTwo != null || CustomColourThree != null || CustomColourFour != null || CustomColourFive != null || CustomTextColourOne != null || CustomTextColourTwo != null || CustomTextColourThree != null || CustomTextColourFour != null || CustomTextColourFive != null || MenuTextColour != null || StatusTextColour != null || RibbonTabTextColour != null)
                {
                    _colourSettingsManager.SetBaseColour(BaseColour);

                    _colourSettingsManager.SetDarkColour(DarkColour);

                    _colourSettingsManager.SetMediumColour(MiddleColour);

                    _colourSettingsManager.SetLightColour(LightColour);

                    _colourSettingsManager.SetLightestColour(LightestColour);

                    _colourSettingsManager.SetBorderColour(BorderColourPreview);

                    _colourSettingsManager.SetAlternativeNormalTextColour(AlternativeNormalTextColourPreview);

                    _colourSettingsManager.SetNormalTextColour(NormalTextColourPreview);

                    _colourSettingsManager.SetDisabledTextColour(DisabledTextColourPreview);

                    _colourSettingsManager.SetFocusedTextColour(FocusedTextColourPreview);

                    _colourSettingsManager.SetPressedTextColour(PressedTextColourPreview);

                    _colourSettingsManager.SetDisabledControlColour(DisabledColourPreview);

                    _colourSettingsManager.SetLinkNormalColour(LinkNormalColourPreview);

                    _colourSettingsManager.SetLinkHoverColour(LinkHoverColourPreview);

                    _colourSettingsManager.SetLinkVisitedColour(LinkVisitedColourPreview);

                    _colourSettingsManager.SetCustomColourOne(CustomColourOne);

                    _colourSettingsManager.SetCustomColourTwo(CustomColourTwo);

                    _colourSettingsManager.SetCustomColourThree(CustomColourThree);

                    _colourSettingsManager.SetCustomColourFour(CustomColourFour);

                    _colourSettingsManager.SetCustomColourFive(CustomColourFive);

                    _colourSettingsManager.SetCustomTextColourOne(CustomTextColourOne);

                    _colourSettingsManager.SetCustomTextColourTwo(CustomTextColourTwo);

                    _colourSettingsManager.SetCustomTextColourThree(CustomTextColourThree);

                    _colourSettingsManager.SetCustomTextColourFour(CustomTextColourFour);

                    _colourSettingsManager.SetCustomTextColourFive(CustomTextColourFive);

                    _colourSettingsManager.SetMenuTextColour(MenuTextColour);

                    _colourSettingsManager.SetStatusStripTextColour(StatusTextColour);

                    _colourSettingsManager.SetRibbonTabTextColour(RibbonTabTextColour);

                    _colourSettingsManager.SaveAllMergedColourSettings(useConfirmDialog);
                }
                else
                {
                    DialogResult result = KryptonMessageBox.Show("One or more colours are not defined, use white & black?", "Non-Defined Colours", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                }
            }
            catch (Exception exc)
            {
                ExceptionHandler.CaptureException(exc, icon: MessageBoxIcon.Error, methodSignature: Helpers.GetCurrentMethod());
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Downloads the file.
        /// </summary>
        /// <param name="downloadClient">The download client.</param>
        /// <param name="sourcePath">The source path.</param>
        /// <param name="destinationPath">The destination path.</param>
        /// <param name="downloadSource">The download source.</param>
        /// <param name="downloadDestination">The download destination.</param>
        /// <param name="amountDownloaded">The amount downloaded.</param>
        /// <param name="currentSpeed">The current speed.</param>
        /// <param name="downloadPercentage">The download percentage.</param>
        /// <param name="downloadProgress">The download progress.</param>
        /// <param name="installUpdateButton">The install update button.</param>
        /// <param name="kryptonInstallUpdateButton">The krypton install update button.</param>
        /// <param name="kryptonUACShieldInstallUpdateButton">The krypton UAC shield install update button.</param>
        /// <param name="hypertextTransferProtocolType">Type of the hypertext transfer protocol.</param>
        public void DownloadFile(WebClient downloadClient, string sourcePath, string destinationPath, KryptonLabel downloadSource = null, KryptonLabel downloadDestination = null, KryptonLabel amountDownloaded = null, KryptonLabel currentSpeed = null, KryptonLabel downloadPercentage = null, ProgressBar downloadProgress = null, Button installUpdateButton = null, KryptonButton kryptonInstallUpdateButton = null, KryptonUACElevatedButton kryptonUACShieldInstallUpdateButton = null, HypertextTransferProtocolType hypertextTransferProtocolType = HypertextTransferProtocolType.HYPERTEXTTRANSFERPROTOCOL)
        {
            try
            {
                xmlFileApplicationUpdaterSettingsManager.SetUpdatePackageServerURLDownloadLocation(sourcePath);

                internalApplicationUpdaterSettingsManager.SetDestinationDownloadPath(destinationPath);

                if (kryptonUACShieldInstallUpdateButton != null)
                {
                    if (destinationPath != null)
                    {
                        kryptonUACShieldInstallUpdateButton.ProcessName = destinationPath;
                    }
                }

                #region Setting Variables Up
                SetDownloadClient(downloadClient);

                SetDownloadSource(downloadSource);

                SetDownloadDestination(downloadDestination);

                SetAmountDownloaded(amountDownloaded);

                SetCurrentSpeed(currentSpeed);

                SetDownloadPercentage(downloadPercentage);

                SetDownloadProgress(downloadProgress);

                SetInstallUpdateButton(installUpdateButton);

                SetKryptonInstallUpdateButton(kryptonInstallUpdateButton);

                SetKryptonUACShieldInstallUpdateButton(kryptonUACShieldInstallUpdateButton);
                #endregion

                if (GetDownloadClient() != null)
                {
                    using (DownloadClient = new WebClient())
                    {
                        GetDownloadClient().DownloadFileCompleted += DownloadFileCompleted;

                        GetDownloadClient().DownloadProgressChanged += DownloadProgressChanged;

                        GetDownloadClient().Disposed += Disposed;

                        Uri uri = sourcePath.StartsWith("http://", StringComparison.OrdinalIgnoreCase) ? new Uri(sourcePath) : new Uri("http://" + sourcePath);

                        try
                        {
                            GetDownloadClient().DownloadFile(uri, destinationPath);
                        }
                        catch (Exception e)
                        {
                            if (_globalMethods.GetIsTargetPlatformSupported())
                            {
                                ExceptionHandler.CaptureException(e, "Error Thrown", MessageBoxButtons.OK, MessageBoxIcon.Error, "UpdaterLogic", "DownloadFile(WebClient downloadClient, string sourcePath, string destinationPath, KryptonLabel downloadSource = null, KryptonLabel downloadDestination = null, KryptonLabel amountDownloaded = null, KryptonLabel currentSpeed = null, KryptonLabel downloadPercentage = null, ProgressBar downloadProgress = null, Button installUpdateButton = null, KryptonButton kryptonInstallUpdateButton = null, KryptonUACElevatedButton kryptonUACShieldInstallUpdateButton = null, HypertextTransferProtocolType hypertextTransferProtocolType = HypertextTransferProtocolType.HYPERTEXTTRANSFERPROTOCOL)");
                            }
                            else
                            {
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                if (_globalMethods.GetIsTargetPlatformSupported())
                {
                    ExceptionHandler.CaptureException(e, "Error Thrown", MessageBoxButtons.OK, MessageBoxIcon.Error, "UpdaterLogic", "DownloadFile(WebClient downloadClient, string sourcePath, string destinationPath, KryptonLabel downloadSource = null, KryptonLabel downloadDestination = null, KryptonLabel amountDownloaded = null, KryptonLabel currentSpeed = null, KryptonLabel downloadPercentage = null, ProgressBar downloadProgress = null, Button installUpdateButton = null, KryptonButton kryptonInstallUpdateButton = null, KryptonUACElevatedButton kryptonUACShieldInstallUpdateButton = null, HypertextTransferProtocolType hypertextTransferProtocolType = HypertextTransferProtocolType.HYPERTEXTTRANSFERPROTOCOL)");
                }
                else
                {
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Creates a new palette.
        /// </summary>
        /// <param name="palette">The palette.</param>
        /// <param name="paletteMode">The palette mode.</param>
        /// <param name="baseColour">The base colour.</param>
        /// <param name="darkColour">The dark colour.</param>
        /// <param name="middleColour">The middle colour.</param>
        /// <param name="lightColour">The light colour.</param>
        /// <param name="lightestColour">The lightest colour.</param>
        /// <param name="borderColourPreview">The border colour preview.</param>
        /// <param name="alternativeNormalTextColourPreview">The alternative normal text colour preview.</param>
        /// <param name="normalTextColourPreview">The normal text colour preview.</param>
        /// <param name="disabledTextColourPreview">The disabled text colour preview.</param>
        /// <param name="focusedTextColourPreview">The focused text colour preview.</param>
        /// <param name="pressedTextColourPreview">The pressed text colour preview.</param>
        /// <param name="disabledControlColourPreview">The disabled colour preview.</param>
        /// <param name="linkNormalColourPreview">The link normal colour preview.</param>
        /// <param name="linkHoverColourPreview">The link hover colour preview.</param>
        /// <param name="linkVisitedColourPreview">The link visited colour preview.</param>
        /// <param name="customColourOne">The custom colour one.</param>
        /// <param name="customColourTwo">The custom colour two.</param>
        /// <param name="customColourThree">The custom colour three.</param>
        /// <param name="customColourFour">The custom colour four.</param>
        /// <param name="customColourFive">The custom colour five.</param>
        /// <param name="customTextColourOne">The custom text colour one.</param>
        /// <param name="customTextColourTwo">The custom text colour two.</param>
        /// <param name="customTextColourThree">The custom text colour three.</param>
        /// <param name="customTextColourFour">The custom text colour four.</param>
        /// <param name="customTextColourFive">The custom text colour five.</param>
        /// <param name="menuTextColour">The menu text colour.</param>
        /// <param name="statusTextColour">The status text colour.</param>
        /// <param name="ribbonTabTextColour">The ribbon tab text colour.</param>
        /// <param name="statusState">State of the status.</param>
        /// <param name="invertColours">if set to <c>true</c> [invert colours].</param>
        public static void CreatePalette(KryptonPalette palette, PaletteMode paletteMode, Color baseColour, Color darkColour, Color middleColour, Color lightColour, Color lightestColour, Color borderColourPreview, Color alternativeNormalTextColourPreview, Color normalTextColourPreview, Color disabledTextColourPreview, Color focusedTextColourPreview, Color pressedTextColourPreview, Color disabledControlColourPreview, Color linkDisabledColourPreview, Color linkFocusedColour, Color linkNormalColourPreview, Color linkHoverColourPreview, Color linkVisitedColourPreview, Color customColourOne, Color customColourTwo, Color customColourThree, Color customColourFour, Color customColourFive, Color customTextColourOne, Color customTextColourTwo, Color customTextColourThree, Color customTextColourFour, Color customTextColourFive, Color menuTextColour, Color statusTextColour, Color ribbonTabTextColour, ToolStripLabel statusState = null, bool invertColours = false)
        {
            palette = new KryptonPalette();

            try
            {
                palette.BasePaletteMode = paletteMode;

                if (lightestColour == Color.Transparent)
                {
                    lightestColour = lightColour;
                }

                if (invertColours)
                {
                    #region Button Cluster
                    palette.ButtonStyles.ButtonCluster.OverrideDefault.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCluster.OverrideFocus.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCluster.StateCheckedNormal.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCluster.StateCommon.Back.ColorStyle = PaletteColorStyle.GlassNormalFull;

                    palette.ButtonStyles.ButtonCluster.StateNormal.Back.Color1 = middleColour;

                    palette.ButtonStyles.ButtonCluster.StatePressed.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCluster.StateTracking.Back.Color1 = darkColour;
                    #endregion

                    #region Button Common
                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Back.Color1 = lightColour;

                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color2 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.ColorStyle = PaletteColorStyle.GlassCheckedFull;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color2 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.ColorStyle = PaletteColorStyle.GlassCheckedStump;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color2 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCommon.Back.Color1 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = disabledControlColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = disabledControlColourPreview;

                    /*
                     * palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = lightColour;
                     *
                     * palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = lightColour;
                     */

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color1 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color2 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color2 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color2 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color2 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color1 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color2 = lightestColour;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Content.ShortText.Color1 = normalTextColourPreview;
                    #endregion

                    #region Common
                    palette.Common.StateCommon.Back.Color1 = darkColour;

                    palette.Common.StateCommon.Back.Color2 = middleColour;

                    palette.Common.StateCommon.Border.Color1 = middleColour;

                    palette.Common.StateCommon.Border.Color2 = lightestColour;

                    palette.Common.StateCommon.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.Common.StateCommon.Content.LongText.Color1 = normalTextColourPreview;

                    palette.Common.StateCommon.Content.LongText.Color2 = normalTextColourPreview;

                    palette.Common.StateCommon.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.Common.StateCommon.Content.ShortText.Color2 = normalTextColourPreview;
                    #endregion

                    #region Form Styles
                    palette.FormStyles.FormCommon.StateActive.Back.Color1 = middleColour;

                    palette.FormStyles.FormCommon.StateActive.Border.DrawBorders = PaletteDrawBorders.All;
                    #endregion

                    #region Grid Styles
                    palette.GridStyles.GridSheet.StateCommon.HeaderColumn.Content.Color1 = darkColour;

                    palette.GridStyles.GridSheet.StateCommon.HeaderRow.Content.Color1 = darkColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color1 = lightestColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color2 = baseColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderRow.Content.Color1 = lightestColour;

                    palette.GridStyles.GridSheet.StateTracking.HeaderColumn.Content.Color1 = middleColour;
                    #endregion
                }
                else
                {
                    #region Button Cluster
                    palette.ButtonStyles.ButtonCluster.OverrideDefault.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCluster.OverrideFocus.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCluster.StateCheckedNormal.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCluster.StateCommon.Back.ColorStyle = PaletteColorStyle.GlassNormalFull;

                    palette.ButtonStyles.ButtonCluster.StateNormal.Back.Color1 = middleColour;

                    palette.ButtonStyles.ButtonCluster.StatePressed.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCluster.StateTracking.Back.Color1 = baseColour;
                    #endregion

                    #region Button Common
                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color1 = lightestColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color2 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.ColorStyle = PaletteColorStyle.GlassCheckedFull;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color1 = lightestColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color2 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.ColorStyle = PaletteColorStyle.GlassCheckedStump;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color1 = lightestColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color2 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCommon.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = disabledControlColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = disabledControlColourPreview;

                    /*
                     * palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = baseColour;
                     *
                     * palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = baseColour;
                     */

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color2 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color2 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color2 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color1 = lightestColour;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color2 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color2 = darkColour;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Content.ShortText.Color1 = alternativeNormalTextColourPreview;
                    #endregion

                    #region Common
                    palette.Common.StateCommon.Back.Color1 = lightestColour;

                    palette.Common.StateCommon.Back.Color2 = baseColour;

                    palette.Common.StateCommon.Border.Color1 = baseColour;

                    palette.Common.StateCommon.Border.Color2 = darkColour;

                    palette.Common.StateCommon.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.Common.StateCommon.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.Common.StateCommon.Content.LongText.Color2 = alternativeNormalTextColourPreview;

                    palette.Common.StateCommon.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.Common.StateCommon.Content.ShortText.Color2 = alternativeNormalTextColourPreview;
                    #endregion

                    #region Form Styles
                    palette.FormStyles.FormCommon.StateActive.Back.Color1 = baseColour;

                    palette.FormStyles.FormCommon.StateActive.Border.DrawBorders = PaletteDrawBorders.All;
                    #endregion

                    #region Grid Styles
                    palette.GridStyles.GridSheet.StateCommon.HeaderColumn.Content.Color1 = lightestColour;

                    palette.GridStyles.GridSheet.StateCommon.HeaderRow.Content.Color1 = lightestColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color1 = darkColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color2 = middleColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderRow.Content.Color1 = darkColour;

                    palette.GridStyles.GridSheet.StateTracking.HeaderColumn.Content.Color1 = baseColour;
                    #endregion

                    #region Header Styles
                    palette.HeaderStyles.HeaderCommon.StateCommon.Back.Color1 = middleColour;

                    palette.HeaderStyles.HeaderCommon.StateCommon.Back.Color2 = lightColour;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Back.Color1 = lightColour;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Back.Color2 = lightestColour;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Content.LongText.Color2 = baseColour;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Content.ShortText.Color2 = baseColour;

                    palette.HeaderStyles.HeaderForm.StateCommon.Back.Color1 = middleColour;

                    palette.HeaderStyles.HeaderForm.StateCommon.Back.Color2 = lightColour;

                    palette.HeaderStyles.HeaderForm.StateDisabled.Back.Color1 = disabledControlColourPreview;

                    palette.HeaderStyles.HeaderForm.StateDisabled.Back.Color2 = baseColour;

                    palette.HeaderStyles.HeaderForm.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview;

                    palette.HeaderStyles.HeaderForm.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview;
                    #endregion

                    #region Label Styles
                    palette.LabelStyles.LabelNormalControl.OverrideNotVisited.LongText.Color1 = linkNormalColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverrideNotVisited.ShortText.Color1 = linkNormalColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverridePressed.LongText.Color1 = linkHoverColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverridePressed.ShortText.Color1 = linkHoverColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverrideVisited.LongText.Color1 = linkVisitedColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverrideVisited.ShortText.Color1 = linkVisitedColourPreview;

                    palette.LabelStyles.LabelNormalControl.StateDisabled.LongText.Color1 = linkDisabledColourPreview;

                    palette.LabelStyles.LabelNormalControl.StateDisabled.ShortText.Color1 = linkDisabledColourPreview;

                    palette.LabelStyles.LabelNormalControl.StateNormal.LongText.Color1 = normalTextColourPreview;

                    palette.LabelStyles.LabelNormalControl.StateNormal.ShortText.Color1 = normalTextColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverrideFocus.LongText.Color1 = linkFocusedColour;

                    palette.LabelStyles.LabelNormalControl.OverrideFocus.ShortText.Color1 = linkFocusedColour;
                    #endregion

                    #region Ribbon
                    palette.Ribbon.RibbonAppButton.StateCommon.BackColor2 = baseColour;

                    palette.Ribbon.RibbonAppButton.StateCommon.BackColor3 = customColourThree;

                    palette.Ribbon.RibbonAppButton.StateCommon.BackColor5 = baseColour;

                    palette.Ribbon.RibbonAppButton.StatePressed.BackColor5 = darkColour;

                    palette.Ribbon.RibbonAppButton.StateTracking.BackColor5 = customColourFive;

                    palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor1 = baseColour;

                    palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor2 = customColourTwo;

                    palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor3 = baseColour;

                    palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor4 = baseColour;

                    palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor5 = baseColour;

                    palette.Ribbon.RibbonGroupButtonText.StateCommon.TextColor = customTextColourTwo;

                    palette.Ribbon.RibbonGroupCheckBoxText.StateCommon.TextColor = customTextColourTwo;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor1 = SystemColors.Window;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor2 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor3 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor4 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor1 = SystemColors.Window;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor2 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor3 = lightestColour; // Or 230, 230, 230

                    palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor4 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor1 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor2 = middleColour;

                    palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor3 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor4 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor5 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor1 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor2 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor3 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor4 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor5 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBorder.StateCommon.BackColor1 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBorder.StateCommon.BackColor2 = lightestColour; // Or 230, 230, 230

                    palette.Ribbon.RibbonGroupCollapsedText.StateCommon.TextColor = alternativeNormalTextColourPreview;

                    palette.Ribbon.RibbonGroupNormalBorder.StateCommon.BackColor1 = baseColour;

                    palette.Ribbon.RibbonGroupNormalBorder.StateCommon.BackColor2 = middleColour;

                    palette.Ribbon.RibbonGroupNormalTitle.StateCommon.BackColor1 = lightestColour; // Or 230, 230, 230

                    palette.Ribbon.RibbonGroupNormalTitle.StateCommon.BackColor2 = middleColour;

                    palette.Ribbon.RibbonGroupNormalTitle.StateCommon.TextColor = customTextColourFive;

                    palette.Ribbon.RibbonGroupNormalTitle.StateTracking.BackColor1 = lightestColour;

                    palette.Ribbon.RibbonGroupNormalTitle.StateTracking.BackColor2 = middleColour;

                    palette.Ribbon.RibbonQATFullbar.BackColor1 = middleColour;

                    palette.Ribbon.RibbonQATFullbar.BackColor2 = middleColour;

                    palette.Ribbon.RibbonQATFullbar.BackColor3 = middleColour;

                    palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor1 = middleColour;

                    palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor2 = middleColour;

                    palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor3 = middleColour;

                    palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor4 = middleColour;

                    palette.Ribbon.RibbonQATOverflow.BackColor1 = middleColour;

                    palette.Ribbon.RibbonQATOverflow.BackColor2 = middleColour;

                    palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor1 = middleColour;

                    palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor2 = lightColour;

                    palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor3 = darkColour;

                    palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor4 = middleColour;

                    palette.Ribbon.RibbonTab.StateCommon.BackColor1 = middleColour;

                    palette.Ribbon.RibbonTab.StateCommon.BackColor3 = middleColour;

                    palette.Ribbon.RibbonTab.StateCommon.BackColor4 = lightColour;

                    palette.Ribbon.RibbonTab.StateCommon.BackColor5 = lightColour;

                    palette.Ribbon.RibbonTab.StateCommon.TextColor = normalTextColourPreview;

                    palette.Ribbon.RibbonTab.StateContextCheckedTracking.BackColor2 = middleColour;

                    palette.Ribbon.RibbonTab.StateTracking.BackColor2 = middleColour;

                    palette.Ribbon.RibbonTab.StateCommon.TextColor = ribbonTabTextColour;
                    #endregion

                    #region Separator Styles
                    palette.SeparatorStyles.SeparatorCommon.StateCommon.Back.Color1 = baseColour;

                    palette.SeparatorStyles.SeparatorCommon.StateCommon.Back.Color2 = baseColour;

                    palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.Color1 = baseColour;

                    palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.Color1 = baseColour;

                    palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.DrawBorders = PaletteDrawBorders.All;
                    #endregion

                    #region Tool Menu Status
                    palette.ToolMenuStatus.Button.ButtonPressedBorder = baseColour;

                    palette.ToolMenuStatus.Button.ButtonSelectedBorder = baseColour;

                    palette.ToolMenuStatus.Button.OverflowButtonGradientBegin = darkColour;

                    palette.ToolMenuStatus.Button.OverflowButtonGradientEnd = baseColour;

                    palette.ToolMenuStatus.Button.OverflowButtonGradientMiddle = middleColour;

                    palette.ToolMenuStatus.Grip.GripDark = baseColour;

                    palette.ToolMenuStatus.Grip.GripLight = customColourFive;

                    palette.ToolMenuStatus.Menu.ImageMarginGradientBegin = baseColour;

                    palette.ToolMenuStatus.Menu.ImageMarginGradientEnd = darkColour;

                    palette.ToolMenuStatus.Menu.ImageMarginGradientMiddle = middleColour;

                    palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientBegin = baseColour;

                    palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientEnd = darkColour;

                    palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientMiddle = middleColour;

                    palette.ToolMenuStatus.Menu.MenuBorder = baseColour;

                    palette.ToolMenuStatus.Menu.MenuItemBorder = darkColour;

                    palette.ToolMenuStatus.Menu.MenuItemPressedGradientBegin = baseColour;

                    palette.ToolMenuStatus.Menu.MenuItemPressedGradientEnd = darkColour;

                    palette.ToolMenuStatus.Menu.MenuItemPressedGradientMiddle = middleColour;

                    palette.ToolMenuStatus.Menu.MenuItemSelected = middleColour;

                    palette.ToolMenuStatus.Menu.MenuItemSelectedGradientBegin = darkColour;

                    palette.ToolMenuStatus.Menu.MenuItemSelectedGradientEnd = baseColour;

                    palette.ToolMenuStatus.Menu.MenuItemText = menuTextColour;

                    palette.ToolMenuStatus.MenuStrip.MenuStripGradientBegin = baseColour;

                    palette.ToolMenuStatus.MenuStrip.MenuStripGradientEnd = darkColour;

                    palette.ToolMenuStatus.MenuStrip.MenuStripText = normalTextColourPreview;

                    palette.ToolMenuStatus.Rafting.RaftingContainerGradientBegin = middleColour;

                    palette.ToolMenuStatus.Rafting.RaftingContainerGradientEnd = darkColour;

                    palette.ToolMenuStatus.Separator.SeparatorDark = baseColour;

                    palette.ToolMenuStatus.Separator.SeparatorLight = lightColour;

                    palette.ToolMenuStatus.StatusStrip.StatusStripGradientBegin = baseColour;

                    palette.ToolMenuStatus.StatusStrip.StatusStripGradientEnd = lightColour;

                    palette.ToolMenuStatus.StatusStrip.StatusStripText = normalTextColourPreview;

                    palette.ToolMenuStatus.ToolStrip.ToolStripBorder = darkColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripContentPanelGradientBegin = lightColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripContentPanelGradientEnd = darkColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripDropDownBackground = middleColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripGradientBegin = darkColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripGradientEnd = lightColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripGradientMiddle = middleColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripPanelGradientBegin = lightColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripPanelGradientEnd = darkColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripText = normalTextColourPreview;
                    #endregion
                }

                palette.Export();

                statusState.Text = $"Palette exported to: { palette.GetCustomisedKryptonPaletteFilePath() }";
            }
            catch (Exception exc)
            {
                ExceptionHandler.CaptureException(exc, icon: MessageBoxIcon.Error, methodSignature: Helpers.GetCurrentMethod());
            }
        }
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.Paint" /> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.</param>
        protected override void OnPaint(PaintEventArgs e)
        {
            if (DesignMode)
            {
                Graphics g = e.Graphics;
                {
                    HatchBrush hatchBrush = null;

                    Pen pen = null;

                    try
                    {
                        switch (FileDlgStartLocation)
                        {
                        case AddonWindowLocation.Right:
                            hatchBrush = new System.Drawing.Drawing2D.HatchBrush(HatchStyle.NarrowHorizontal, Color.Black, Color.Red);

                            pen = new Pen(hatchBrush, 5);

                            g.DrawLine(pen, 0, 0, 0, this.Height);
                            break;

                        case AddonWindowLocation.Bottom:
                            hatchBrush = new System.Drawing.Drawing2D.HatchBrush(HatchStyle.NarrowVertical, Color.Black, Color.Red);

                            pen = new Pen(hatchBrush, 5);

                            g.DrawLine(pen, 0, 0, this.Width, 0);
                            break;

                        case AddonWindowLocation.BottomRight:
                        default:
                            hatchBrush = new System.Drawing.Drawing2D.HatchBrush(HatchStyle.Sphere, Color.Black, Color.Red);

                            pen = new Pen(hatchBrush, 5);

                            g.DrawLine(pen, 0, 0, 4, 4);
                            break;
                        }
                    }
                    catch (Exception exc)
                    {
                        ExceptionHandler.CaptureException(exc);
                    }
                    finally
                    {
                        if (pen != null)
                        {
                            pen.Dispose();
                        }

                        if (hatchBrush != null)
                        {
                            hatchBrush.Dispose();
                        }
                    }
                }
            }

            base.OnPaint(e);
        }
Ejemplo n.º 7
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());
            }
        }
        /// <summary>
        /// Merges all colours.
        /// </summary>
        /// <param name="darkColour">The dark colour.</param>
        /// <param name="middleColour">The middle colour.</param>
        /// <param name="lightColour">The light colour.</param>
        /// <param name="lightestColour">The lightest colour.</param>
        /// <param name="borderColourPreview">The border colour preview.</param>
        /// <param name="alternativeNormalTextColourPreview">The alternative normal text colour preview.</param>
        /// <param name="normalTextColourPreview">The normal text colour preview.</param>
        /// <param name="disabledTextColourPreview">The disabled text colour preview.</param>
        /// <param name="focusedTextColourPreview">The focused text colour preview.</param>
        /// <param name="pressedTextColourPreview">The pressed text colour preview.</param>
        /// <param name="disabledColourPreview">The disabled colour preview.</param>
        /// <param name="linkNormalColourPreview">The link normal colour preview.</param>
        /// <param name="linkHoverColourPreview">The link hover colour preview.</param>
        /// <param name="linkVisitedColourPreview">The link visited colour preview.</param>
        /// <param name="customColourOne">The custom colour one.</param>
        /// <param name="customColourTwo">The custom colour two.</param>
        /// <param name="customColourThree">The custom colour three.</param>
        /// <param name="customColourFour">The custom colour four.</param>
        /// <param name="customColourFive">The custom colour five.</param>
        /// <param name="customTextColourOne">The custom text colour one.</param>
        /// <param name="customTextColourTwo">The custom text colour two.</param>
        /// <param name="customTextColourThree">The custom text colour three.</param>
        /// <param name="customTextColourFour">The custom text colour four.</param>
        /// <param name="customTextColourFive">The custom text colour five.</param>
        /// <param name="menuTextColour">The menu text colour.</param>
        /// <param name="statusTextColour">The status text colour.</param>
        /// <param name="ribbonTabTextColour">The ribbon tab text colour.</param>
        /// <param name="usePrompt">if set to <c>true</c> [use prompt].</param>
        public static void MergeAllColours(Color baseColour, Color darkColour, Color middleColour, Color lightColour, Color lightestColour, Color borderColour, Color alternativeNormalTextColour, Color normalTextColour, Color disabledTextColour, Color focusedTextColour, Color pressedTextColour, Color disabledControlColour, Color linkDisabledColour, Color linkFocusedColour, Color linkNormalColour, Color linkHoverColour, Color linkVisitedColour, Color customColourOne, Color customColourTwo, Color customColourThree, Color customColourFour, Color customColourFive, Color customTextColourOne, Color customTextColourTwo, Color customTextColourThree, Color customTextColourFour, Color customTextColourFive, Color menuTextColour, Color statusTextColour, Color ribbonTabTextColour, bool usePrompt = false)
        {
            #region Variables
            ColourSettingsManager colourSettingsManager = new ColourSettingsManager();
            #endregion

            try
            {
                if (BasicPaletteColourManager.AreBasicPaletteColoursEmpty() || CustomPaletteColourManager.AreCustomPaletteColoursEmpty() || CustomPaletteTextColourManager.AreCustomPaletteTextColoursEmpty() || LinkTextPaletteColourManager.AreLinkTextPaletteColoursEmpty() || MiscellaneousPaletteColourManager.AreMiscellaneousPaletteColoursEmpty() || TextPaletteColourManager.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(alternativeNormalTextColour);

                            colourSettingsManager.SetBaseColour(baseColour);

                            colourSettingsManager.SetBorderColour(borderColour);

                            colourSettingsManager.SetCustomColourOne(customColourOne);

                            colourSettingsManager.SetCustomColourTwo(customColourTwo);

                            colourSettingsManager.SetCustomColourThree(customColourThree);

                            colourSettingsManager.SetCustomColourFour(customColourFour);

                            colourSettingsManager.SetCustomColourFive(customColourFive);

                            colourSettingsManager.SetCustomTextColourOne(customTextColourOne);

                            colourSettingsManager.SetCustomTextColourTwo(customTextColourTwo);

                            colourSettingsManager.SetCustomTextColourThree(customTextColourThree);

                            colourSettingsManager.SetCustomTextColourFour(customTextColourFour);

                            colourSettingsManager.SetCustomTextColourFive(customTextColourFive);

                            colourSettingsManager.SetDarkestColour(darkColour);

                            colourSettingsManager.SetDisabledControlColour(disabledControlColour);

                            colourSettingsManager.SetDisabledTextColour(disabledTextColour);

                            colourSettingsManager.SetFocusedTextColour(focusedTextColour);

                            colourSettingsManager.SetLightColour(lightColour);

                            colourSettingsManager.SetLightestColour(lightestColour);

                            colourSettingsManager.SetLinkDisabledColour(linkDisabledColour);

                            colourSettingsManager.SetLinkFocusedColour(linkFocusedColour);

                            colourSettingsManager.SetLinkHoverColour(linkHoverColour);

                            colourSettingsManager.SetLinkNormalColour(linkNormalColour);

                            colourSettingsManager.SetLinkVisitedColour(linkVisitedColour);

                            colourSettingsManager.SetMediumColour(middleColour);

                            colourSettingsManager.SetMenuTextColour(menuTextColour);

                            colourSettingsManager.SetNormalTextColour(normalTextColour);

                            colourSettingsManager.SetPressedTextColour(pressedTextColour);

                            colourSettingsManager.SetRibbonTabTextColour(ribbonTabTextColour);

                            colourSettingsManager.SetStatusStripTextColour(statusTextColour);

                            colourSettingsManager.SaveColourSettings(usePrompt);
                        }
                    }
                    else
                    {
                        colourSettingsManager.SetAlternativeNormalTextColour(alternativeNormalTextColour);

                        colourSettingsManager.SetBaseColour(baseColour);

                        colourSettingsManager.SetBorderColour(borderColour);

                        colourSettingsManager.SetCustomColourOne(customColourOne);

                        colourSettingsManager.SetCustomColourTwo(customColourTwo);

                        colourSettingsManager.SetCustomColourThree(customColourThree);

                        colourSettingsManager.SetCustomColourFour(customColourFour);

                        colourSettingsManager.SetCustomColourFive(customColourFive);

                        colourSettingsManager.SetCustomTextColourOne(customTextColourOne);

                        colourSettingsManager.SetCustomTextColourTwo(customTextColourTwo);

                        colourSettingsManager.SetCustomTextColourThree(customTextColourThree);

                        colourSettingsManager.SetCustomTextColourFour(customTextColourFour);

                        colourSettingsManager.SetCustomTextColourFive(customTextColourFive);

                        colourSettingsManager.SetDarkestColour(darkColour);

                        colourSettingsManager.SetDisabledControlColour(disabledControlColour);

                        colourSettingsManager.SetDisabledTextColour(disabledTextColour);

                        colourSettingsManager.SetFocusedTextColour(focusedTextColour);

                        colourSettingsManager.SetLightColour(lightColour);

                        colourSettingsManager.SetLightestColour(lightestColour);

                        colourSettingsManager.SetLinkDisabledColour(linkDisabledColour);

                        colourSettingsManager.SetLinkFocusedColour(linkFocusedColour);

                        colourSettingsManager.SetLinkHoverColour(linkHoverColour);

                        colourSettingsManager.SetLinkNormalColour(linkNormalColour);

                        colourSettingsManager.SetLinkVisitedColour(linkVisitedColour);

                        colourSettingsManager.SetMediumColour(middleColour);

                        colourSettingsManager.SetMenuTextColour(menuTextColour);

                        colourSettingsManager.SetNormalTextColour(normalTextColour);

                        colourSettingsManager.SetPressedTextColour(pressedTextColour);

                        colourSettingsManager.SetRibbonTabTextColour(ribbonTabTextColour);

                        colourSettingsManager.SetStatusStripTextColour(statusTextColour);

                        colourSettingsManager.SaveColourSettings();
                    }
                }
            }
            catch (Exception exc)
            {
                ExceptionHandler.CaptureException(exc, "Exception Caught", MessageBoxButtons.OK, MessageBoxIcon.Error, "SettingsManager", "MergeAllColours(Color baseColour, Color darkColour, Color middleColour, Color lightColour, Color lightestColour, Color borderColour, Color alternativeNormalTextColour, Color normalTextColour, Color disabledTextColour, \nColor focusedTextColour, Color pressedTextColour, Color disabledControlColour, Color linkDisabledColour, Color linkFocusedColour, Color linkNormalColour, Color linkHoverColour, Color linkVisitedColour, Color customColourOne, Color customColourTwo, Color customColourThree, Color customColourFour, \nColor customColourFive, Color customTextColourOne, Color customTextColourTwo, Color customTextColourThree, Color customTextColourFour, Color customTextColourFive, Color menuTextColour, Color statusTextColour, Color ribbonTabTextColour, bool usePrompt = false)");
            }
        }
Ejemplo n.º 9
0
        private void kbtnScan_Click(object sender, EventArgs e)
        {
            if (ktxtWorkGroupName.Text == "")
            {
                return;
            }

            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("ComputerName", typeof(String)));      //0
            dt.Columns.Add(new DataColumn("ComputerIP", typeof(String)));        //1
            dt.Columns.Add(new DataColumn("ComputerMAC", typeof(String)));       //2

            try
            {
                // Use Your work Group WinNT://&&&&(Work Group Name)
                DirectoryEntry DomainEntry = new DirectoryEntry("WinNT://" + ktxtWorkGroupName.Text + "");
                DomainEntry.Children.SchemaFilter.Add("Computer");

                ///*************************************************
                /// ITERATING THROUGH ALL MACHINES IN DOMAIN ENTRY
                ///*************************************************
                foreach (DirectoryEntry machine in DomainEntry.Children)
                {
                    string    strMachineName = machine.Name;
                    string    strMACAddress;
                    IPAddress ipAddress;


                    try
                    {
                        ipAddress = GetIPByName(machine.Name);
                    }
                    catch
                    {
                        continue;
                    }//try/catch

                    ///*************************************************
                    /// GETTING MAC ADDRESS
                    ///*************************************************
                    strMACAddress = GetMACAddress(ipAddress);

                    ///*************************************************
                    /// ADD ROWS TO OUR DATA TABLE
                    ///*************************************************

                    DataRow dr = dt.NewRow();

                    dr[0] = machine.Name;
                    dr[1] = ipAddress.ToString();
                    dr[2] = strMACAddress;

                    dt.Rows.Add(dr);
                }//foreach loop

                ///*************************************************
                /// SETTING DATASOURCE
                ///*************************************************
                kdgvNodes.DataSource = dt;
            }//try/catch
            catch (Exception ex)
            {
                ExceptionHandler.CaptureException(ex);
            }
        }