Exemplo n.º 1
0
 public Systems()
 {
     configSystem   = new ConfigSystem();
     mimeSystem     = new MimeSystem();
     packSystem     = new PackSystem();
     languageSystem = new LanguageSystem();
 }
        /// <summary>
        /// 更新Ui
        /// </summary>
        public void UpdateUi()
        {
            WaitUiControl  _waitUiControl  = AppManager.MainWindow.WaitUiControl;
            LanguageSystem _languageSystem = AppManager.Systems.LanguageSystem;

            /* 更新Ui */
            _waitUiControl.WaitTextBlock.Text = _languageSystem.waitInWaitUi;
        }
        /// <summary>
        /// 更新Ui
        /// </summary>
        /// <param name="_configData">配置文件的数据</param>
        public void UpdateUi(ConfigData _configData)
        {
            PackUiControl  _packUiControl  = AppManager.MainWindow.PackUiControl;
            LanguageSystem _languageSystem = AppManager.Systems.LanguageSystem;

            /* 更新Ui */
            //配置文件
            _packUiControl.TitleTextBlock.Text        = _languageSystem.titleInPackUi;
            _packUiControl.Content1TextBlock.Text     = _languageSystem.content1InPackUi;
            _packUiControl.Content2TextBlock.Text     = _languageSystem.content2InPackUi;
            _packUiControl.Content3TextBlock.Text     = _languageSystem.content3InPackUi;
            _packUiControl.IntroductionButton.Content = _languageSystem.introductionButtonInPackUi;
            _packUiControl.ChooseConfigButton.Content = _languageSystem.chooseConfigButtonInPackUi;
            _packUiControl.OkButton.Content           = _languageSystem.okButtonInPackUi;
            _packUiControl.FilePathTextBox.Text       = _configData.configFilePath;
            _packUiControl.NoteTextBlock.Text         = Path.GetFileName(_configData.configFilePath) + _languageSystem.noteInPackUi;

            //Js文件
            _packUiControl.JsTitleTextBlock.Text        = _languageSystem.jsTitleInPackUi;
            _packUiControl.JsFilePathsInfoControl.Title = _languageSystem.jsFilePathsTitleInPackUi;
            string _jsFilePaths = "";

            for (int i = 0; i < _configData.js.filePaths.Count; i++)
            {
                //如果是最后1个
                if (i == _configData.js.filePaths.Count - 1)
                {
                    _jsFilePaths += _configData.js.filePaths[i];
                }
                //如果不是最后1个
                else
                {
                    _jsFilePaths += _configData.js.filePaths[i] + "\n";
                }
            }
            _packUiControl.JsFilePathsInfoControl.Content                = _jsFilePaths;
            _packUiControl.JsOutputPathInfoControl.Title                 = _languageSystem.jsOutputPathTitleInPackUi;
            _packUiControl.JsOutputPathInfoControl.Content               = _configData.js.outputPath;
            _packUiControl.JsIsDeleteCommentedOutCodeInfoControl.Title   = _languageSystem.jsIsDeleteCommentedOutCodeTitleInPackUi;
            _packUiControl.JsIsDeleteCommentedOutCodeInfoControl.Content = _configData.js.isDeleteCommentedOutCode + "";

            //Css文件
            _packUiControl.CssTitleTextBlock.Text        = _languageSystem.cssTitleInPackUi;
            _packUiControl.CssFilePathsInfoControl.Title = _languageSystem.cssFilePathsTitleInPackUi;
            string _cssFilePaths = "";

            for (int i = 0; i < _configData.css.filePaths.Count; i++)
            {
                //如果是最后1个
                if (i == _configData.css.filePaths.Count - 1)
                {
                    _cssFilePaths += _configData.css.filePaths[i];
                }
                //如果不是最后1个
                else
                {
                    _cssFilePaths += _configData.css.filePaths[i] + "\n";
                }
            }
            _packUiControl.CssFilePathsInfoControl.Content                = _cssFilePaths;
            _packUiControl.CssOutputPathInfoControl.Title                 = _languageSystem.cssOutputPathTitleInPackUi;
            _packUiControl.CssOutputPathInfoControl.Content               = _configData.css.outputPath;
            _packUiControl.CssIsDeleteCommentedOutCodeInfoControl.Title   = _languageSystem.cssIsDeleteCommentedOutCodeTitleInPackUi;
            _packUiControl.CssIsDeleteCommentedOutCodeInfoControl.Content = _configData.css.isDeleteCommentedOutCode + "";
            _packUiControl.CssIsOutputOtherFileInfoControl.Title          = _languageSystem.cssIsOutputOtherFileTitleInPackUi;
            _packUiControl.CssIsOutputOtherFileInfoControl.Content        = _configData.css.isOutputOtherFile + "";
            _packUiControl.CssOtherFileOutputPathInfoControl.Title        = _languageSystem.cssOtherFileOutputPathTitleInPackUi;
            _packUiControl.CssOtherFileOutputPathInfoControl.Content      = _configData.css.otherFileOutputPath;
            _packUiControl.CssIsOtherFileConvertBase64InfoControl.Title   = _languageSystem.cssIsOtherFileConvertBase64TitleInPackUi;
            _packUiControl.CssIsOtherFileConvertBase64InfoControl.Content = _configData.css.isOtherFileConvertBase64 + "";
            _packUiControl.CssBase64ConvertLimitInfoControl.Title         = _languageSystem.cssBase64ConvertLimitTitleInPackUi;
            _packUiControl.CssBase64ConvertLimitInfoControl.Content       = _configData.css.base64ConvertLimit + " B";

            //Html文件
            _packUiControl.HtmlTitleTextBlock.Text                         = _languageSystem.htmlTitleInPackUi;
            _packUiControl.HtmlFilePathInfoControl.Title                   = _languageSystem.htmlFilePathTitleInPackUi;
            _packUiControl.HtmlFilePathInfoControl.Content                 = _configData.html.filePath;
            _packUiControl.HtmlOutputPathInfoControl.Title                 = _languageSystem.htmlOutputPathTitleInPackUi;
            _packUiControl.HtmlOutputPathInfoControl.Content               = _configData.html.outputPath;
            _packUiControl.HtmlIsDeleteCommentedOutCodeInfoControl.Title   = _languageSystem.htmlIsDeleteCommentedOutCodeTitleInPackUi;
            _packUiControl.HtmlIsDeleteCommentedOutCodeInfoControl.Content = _configData.html.isDeleteCommentedOutCode + "";
            _packUiControl.HtmlIsOutputOtherFileInfoControl.Title          = _languageSystem.htmlIsOutputOtherFileTitleInPackUi;
            _packUiControl.HtmlIsOutputOtherFileInfoControl.Content        = _configData.html.isOutputOtherFile + "";
            _packUiControl.HtmlOtherFileOutputPathInfoControl.Title        = _languageSystem.htmlOtherFileOutputPathTitleInPackUi;
            _packUiControl.HtmlOtherFileOutputPathInfoControl.Content      = _configData.html.otherFileOutputPath;
            _packUiControl.HtmlIsOtherFileConvertBase64InfoControl.Title   = _languageSystem.htmlIsOtherFileConvertBase64TitleInPackUi;
            _packUiControl.HtmlIsOtherFileConvertBase64InfoControl.Content = _configData.html.isOtherFileConvertBase64 + "";
            _packUiControl.HtmlBase64ConvertLimitInfoControl.Title         = _languageSystem.htmlBase64ConvertLimitTitleInPackUi;
            _packUiControl.HtmlBase64ConvertLimitInfoControl.Content       = _configData.html.base64ConvertLimit + " B";
        }