Beispiel #1
0
        /// <summary>
        ///     Processes a theme on the supplied applicator.
        /// </summary>
        private static void Process(StyleApplicator applicator)
        {
            if (applicator == null)
            {
                return;
            }

            // get the default skin
            UISkinDef skin = UISkinManager.defaultSkin;

            if (skin == null)
            {
                return;
            }

            // apply selected theme type
            switch (applicator.ElementType)
            {
            case StyleApplicator.ElementTypes.Window:
                applicator.SetImage(skin.window.normal.background, Image.Type.Sliced);
                break;

            case StyleApplicator.ElementTypes.Box:
                applicator.SetImage(skin.box.normal.background, Image.Type.Sliced);
                break;

            case StyleApplicator.ElementTypes.Button:
                applicator.SetSelectable(null, skin.button.normal.background,
                                         skin.button.highlight.background,
                                         skin.button.active.background,
                                         skin.button.disabled.background);
                break;

            case StyleApplicator.ElementTypes.ButtonToggle:
                applicator.SetToggle(null, skin.button.normal.background,
                                     skin.button.highlight.background,
                                     skin.button.active.background,
                                     skin.button.disabled.background);
                break;

            case StyleApplicator.ElementTypes.Label:
                applicator.SetText(GetTextStyle(skin.label, skin.label.normal));
                break;
            }
        }
        /// <summary>
        ///     Processes a theme on the supplied applicator.
        /// </summary>
        private static void Process(StyleApplicator applicator)
        {
            if (applicator == null)
            {
                return;
            }

            // get the default skin
            UISkinDef skin = UISkinManager.defaultSkin;
            if (skin == null)
            {
                return;
            }

            // apply selected theme type
            switch (applicator.ElementType)
            {
                case StyleApplicator.ElementTypes.Window:
                    applicator.SetImage(skin.window.normal.background, Image.Type.Sliced);
                    break;

                case StyleApplicator.ElementTypes.Box:
                    applicator.SetImage(skin.box.normal.background, Image.Type.Sliced);
                    break;

                case StyleApplicator.ElementTypes.Button:
                    applicator.SetSelectable(null, skin.button.normal.background,
                        skin.button.highlight.background,
                        skin.button.active.background,
                        skin.button.disabled.background);
                    break;

                case StyleApplicator.ElementTypes.ButtonToggle:
                    applicator.SetToggle(null, skin.button.normal.background,
                        skin.button.highlight.background,
                        skin.button.active.background,
                        skin.button.disabled.background);
                    break;

                case StyleApplicator.ElementTypes.Label:
                    applicator.SetText(GetTextStyle(skin.label, skin.label.normal));
                    break;
            }
        }