Пример #1
0
        public static void ShowLoadThemeDialog()
        {
            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();
            SkinManager    skinManager   = ServiceRegistration.Get <ISkinResourceManager>() as SkinManager;

            if (skinManager == null)
            {
                return;
            }
            string currentSkinName = screenManager.CurrentSkinResourceBundle.SkinName;
            Skin   currentSkin;

            if (!skinManager.Skins.TryGetValue(currentSkinName, out currentSkin))
            {
                return;
            }
            ItemsList themeItems = new ItemsList();

            foreach (Theme theme in currentSkin.Themes.Values)
            {
                if (!theme.IsValid)
                {
                    continue;
                }
                string   themeName = theme.Name;
                ListItem themeItem = new ListItem(Consts.KEY_NAME, themeName)
                {
                    Command = new MethodDelegateCommand(() => screenManager.SwitchSkinAndTheme(null, themeName))
                };
                themeItems.Add(themeItem);
            }
            ShowDialog(Consts.RES_LOAD_THEME_TITLE, themeItems);
        }
Пример #2
0
        public static void ShowLoadSkinDialog()
        {
            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();
            SkinManager    skinManager   = ServiceRegistration.Get <ISkinResourceManager>() as SkinManager;

            if (skinManager == null)
            {
                return;
            }
            ItemsList skinItems = new ItemsList();

            foreach (Skin skin in skinManager.Skins.Values)
            {
                if (!skin.IsValid)
                {
                    continue;
                }
                string   skinName = skin.Name;
                ListItem skinItem = new ListItem(Consts.KEY_NAME, skinName)
                {
                    Command = new MethodDelegateCommand(() => screenManager.SwitchSkinAndTheme(skinName, null))
                };
                skinItems.Add(skinItem);
            }
            ShowDialog(Consts.RES_LOAD_SKIN_TITLE, skinItems);
        }
Пример #3
0
        public void ChangeSkin()
        {
            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();

            if (screenManager.CurrentSkinResourceBundle.SkinName != "Nereus")
            {
                screenManager.SwitchSkinAndTheme("Nereus", "default");
            }
        }
Пример #4
0
        public override void Save()
        {
            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();

            if (screenManager == null)
            {
                return;
            }
            screenManager.SwitchSkinAndTheme(_currentSkinName, null);
        }
Пример #5
0
        void ReloadThemeAction()
        {
            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();

            screenManager.SwitchSkinAndTheme(_skinName, _themeName);
        }