Пример #1
0
        void CheckForThemes()
        {
            // if its digital, we dont care about the theme
            if (ShowDigital)
            {
                return;
            }

            // check if we have a 24hr theme available
            bool has24hourtheme = false;

            if (CurrentTheme.EndsWith("-24") || Directory.Exists(ThemePath + "-24"))
            {
                has24hourtheme = true;
            }

            // check if we have a 12hr theme available
            bool has12hourtheme = false;

            if (!CurrentTheme.EndsWith("-24") || Directory.Exists(ThemePath.Substring(0, ThemePath.Length - 3)))
            {
                has12hourtheme = true;
            }

            // make sure military and the theme match
            if (ShowMilitary)
            {
                if (!has24hourtheme)
                {
                    ShowMilitary = false;
                }
                else if (!CurrentTheme.EndsWith("-24"))
                {
                    CurrentTheme = CurrentTheme + "-24";
                }
            }
            else
            {
                if (!has12hourtheme)
                {
                    ShowMilitary = true;
                }
                else if (CurrentTheme.EndsWith("-24"))
                {
                    CurrentTheme = CurrentTheme.Substring(0, CurrentTheme.Length - 3);
                }
            }
        }