Beispiel #1
0
        private bool findSkinAndSelectWithThemeAndLanguage(string skinName, BoloUI.Basic ctrlUI = null)
        {
            BoloUI.ResBasic skinBasic;

            if (m_mapSkin.TryGetValue(skinName, out skinBasic))
            {
                skinBasic.changeSelectItem(ctrlUI);
                setAllChildExpand(skinBasic);

                return true;
            }
            else
            {
                List<SkinUsingCount_T> lstSkinCount = getIncludeSkinGroupList(skinName);
                if (lstSkinCount != null && lstSkinCount.Count > 0)
                {
                    string path = Project.Setting.s_skinPath + "\\" + lstSkinCount[0].m_groupName + ".xml";

                    changeSelectSkinAndFile(path, skinName, ctrlUI);

                    return true;
                }
            }

            return false;
        }
Beispiel #2
0
        public bool findSkinAndSelect(string skinName, BoloUI.Basic ctrlUI = null)
        {
            bool ret = false;

            if (MainWindow.s_pW.mx_isEnableTheme.IsChecked != true)
            {
                ret = findSkinAndSelectWithThemeAndLanguage(skinName, ctrlUI);
            }
            else
            {
                ComboBoxItem cbiCurTheme = null;
                ComboBoxItem cbiCurLanguage = null;
                string curThemeName = "";
                string curLangName = "";

                if (MainWindow.s_pW.mx_cbThemeName.SelectedItem != null && MainWindow.s_pW.mx_cbThemeName.SelectedItem is ComboBoxItem)
                {
                    cbiCurTheme = (ComboBoxItem)MainWindow.s_pW.mx_cbThemeName.SelectedItem;
                }
                if (MainWindow.s_pW.mx_cbLangName.SelectedItem != null && MainWindow.s_pW.mx_cbLangName.SelectedItem is ComboBoxItem)
                {
                    cbiCurLanguage = (ComboBoxItem)MainWindow.s_pW.mx_cbLangName.SelectedItem;
                }
                if (cbiCurTheme != null)
                {
                    curThemeName = cbiCurTheme.Content.ToString();
                }
                if (cbiCurLanguage != null)
                {
                    curLangName = cbiCurLanguage.Content.ToString();
                }

                string skinName_full = skinName + "{" + curThemeName + "}" + "{" + curLangName + "}";
                string skinName_onlyTheme = skinName + "{" + curThemeName + "}" + "{}";
                string skinName_onlyLang = skinName + "{}" + "{" + curLangName + "}";
                string skinName_none = skinName + "{}{}";

                ret = findSkinAndSelectWithThemeAndLanguage(skinName_full, ctrlUI);
                if (ret == false)
                {
                    ret = findSkinAndSelectWithThemeAndLanguage(skinName_onlyTheme, ctrlUI);
                    if (ret == false)
                    {
                        ret = findSkinAndSelectWithThemeAndLanguage(skinName_onlyLang, ctrlUI);
                        if (ret == false)
                        {
                            ret = findSkinAndSelectWithThemeAndLanguage(skinName_none, ctrlUI);
                            if (ret == false)
                            {
                                ret = findSkinAndSelectWithThemeAndLanguage(skinName, ctrlUI);
                            }
                        }
                    }
                }
            }
            if(ret == false)
            {
                Public.ResultLink.createResult("\r\n没有找到该皮肤。(" + skinName + ")", Public.ResultType.RT_ERROR);
            }

            return ret;
        }
Beispiel #3
0
        public static void changeSelectSkinAndFile(string path, string skinName, BoloUI.Basic ctrlUI = null)
        {
            if (File.Exists(path))
            {
                OpenedFile skinFile;

                //pW.openFileByPath(path, skinName);
                MainWindow.s_pW.openFileByPath(path);
                if (MainWindow.s_pW.m_mapOpenedFiles.TryGetValue(path, out skinFile))
                {
                    if (skinFile.m_frame != null)
                    {
                        if (skinFile.m_frame is XmlControl)
                        {
                            XmlControl xmlCtrl = (XmlControl)skinFile.m_frame;
                            BoloUI.ResBasic skinBasic;

                            if(xmlCtrl.m_mapSkin.TryGetValue(skinName, out skinBasic))
                            {
                                skinBasic.changeSelectItem(ctrlUI);
                                setAllChildExpand(skinBasic);
                            }
                            else
                            {
                                Public.ResultLink.createResult("\r\n没有找到该皮肤。(" + skinName + ")", Public.ResultType.RT_WARNING);
                            }
                        }
                    }
                    else
                    {
                        skinFile.m_preViewSkinName = skinName;
                        skinFile.m_prePlusCtrlUI = ctrlUI;
                    }
                }
            }
            else
            {
                Public.ResultLink.createResult("\r\n文件:\"" + path + "\"不存在,请检查路径。", Public.ResultType.RT_WARNING);
            }
        }