Carrotware.CMS.UI.Controls.TwoLevelNavigation.ParseCSS C# (CSharp) Метод

ParseCSS() приватный Метод

private ParseCSS ( ) : void
Результат void
        private void ParseCSS()
        {
            if (String.IsNullOrEmpty(this.OverrideCSS) && !this.AutoStylingDisabled && String.IsNullOrEmpty(cssText.Text)) {
                string sCSSText = ControlUtilities.GetManifestResourceStream("Carrotware.CMS.UI.Controls.TopMenu.txt");

                if (this.AttemptResponsiveCSS) {
                    string sCSS1 = ControlUtilities.GetManifestResourceStream("Carrotware.CMS.UI.Controls.TopMenuRes.txt");
                    sCSSText = sCSS1.Replace("{DESKTOP_CSS}", sCSSText);
                }

                if (!String.IsNullOrEmpty(sCSSText)) {
                    sCSSText = sCSSText.Replace("{FORE_HEX}", ColorTranslator.ToHtml(this.ForeColor).ToLowerInvariant());
                    sCSSText = sCSSText.Replace("{BG_HEX}", ColorTranslator.ToHtml(this.BGColor).ToLowerInvariant());

                    sCSSText = sCSSText.Replace("{HOVER_FORE_HEX}", ColorTranslator.ToHtml(this.HoverFGColor).ToLowerInvariant());
                    sCSSText = sCSSText.Replace("{HOVER_BG_HEX}", ColorTranslator.ToHtml(this.HoverBGColor).ToLowerInvariant());

                    sCSSText = sCSSText.Replace("{SEL_FORE_HEX}", ColorTranslator.ToHtml(this.SelFGColor).ToLowerInvariant());
                    sCSSText = sCSSText.Replace("{SEL_BG_HEX}", ColorTranslator.ToHtml(this.SelBGColor).ToLowerInvariant());

                    sCSSText = sCSSText.Replace("{UNSEL_FORE_HEX}", ColorTranslator.ToHtml(this.UnSelFGColor).ToLowerInvariant());
                    sCSSText = sCSSText.Replace("{UNSEL_BG_HEX}", ColorTranslator.ToHtml(this.UnSelBGColor).ToLowerInvariant());

                    sCSSText = sCSSText.Replace("{SUB_FORE_HEX}", ColorTranslator.ToHtml(this.SubFGColor).ToLowerInvariant());
                    sCSSText = sCSSText.Replace("{SUB_BG_HEX}", ColorTranslator.ToHtml(this.SubBGColor).ToLowerInvariant());

                    if (this.FontSize.Value > 0) {
                        sCSSText = sCSSText.Replace("{FONT_SIZE}", this.FontSize.ToString());
                    } else {
                        sCSSText = sCSSText.Replace("{FONT_SIZE}", "inherit");
                    }

                    if (this.MenuFontSize.Value > 0) {
                        sCSSText = sCSSText.Replace("{MAIN_FONT_SIZE}", this.MenuFontSize.ToString());
                    } else {
                        sCSSText = sCSSText.Replace("{MAIN_FONT_SIZE}", "inherit");
                    }

                    if (this.MobileWidth.Value > 50) {
                        sCSSText = sCSSText.Replace("{MOBILE_WIDTH}", this.MobileWidth.ToString());
                    } else {
                        sCSSText = sCSSText.Replace("{MOBILE_WIDTH}", "100%");
                    }

                    if (this.MobileWidth.Value > 50) {
                        sCSSText = sCSSText.Replace("{DESK_WIDTH}", (this.MobileWidth.Value + 1).ToString() + this.MobileWidth.Type);
                    } else {
                        sCSSText = sCSSText.Replace("{DESK_WIDTH}", "100%");
                    }

                    sCSSText = sCSSText.Replace("{MENU_SELECT_CLASS}", this.CSSSelected);
                    sCSSText = sCSSText.Replace("{MENU_HASCHILD_CLASS}", this.CSSHasChildren);

                    if (!String.IsNullOrEmpty(this.TopBackgroundStyle)) {
                        this.TopBackgroundStyle = this.TopBackgroundStyle.Replace(";", "");
                        sCSSText = sCSSText.Replace("{TOP_BACKGROUND_STYLE}", "background: " + this.TopBackgroundStyle + ";");
                    } else {
                        sCSSText = sCSSText.Replace("{TOP_BACKGROUND_STYLE}", "");
                    }

                    sCSSText = sCSSText.Replace("{MENU_ID}", "#" + this.HtmlClientID + "");
                    sCSSText = sCSSText.Replace("{MENU_WRAPPER_ID}", "#" + this.HtmlClientID + "-wrapper");
                    sCSSText = "\r\n\t<style type=\"text/css\">\r\n" + sCSSText + "\r\n\t</style>\r\n";
                    //sCSSText = "\r\n\t<div type=\"text/css\">\r\n" + sCSSText + "\r\n\t</div>\r\n";
                    cssText.Text = sCSSText;
                }
            }
        }