Beispiel #1
0
        /// <summary>
        /// 点击合并压缩按钮
        /// </summary>
        /// <param name="sender">引发对象</param>
        /// <param name="e">事件参数</param>
        private void btnMergeCompress_Click(object sender, EventArgs e)
        {
            var files = lbxLanguageLibJsonFiles.DataSource as string[];

            if (files.IsNullOrLength0())
            {
                MessageBox.Show("请先选择语系库文件");

                return;
            }
            if (string.IsNullOrWhiteSpace(txtJsonCompress.Text))
            {
                MessageBox.Show("请先填写压缩后的文件前辍");

                return;
            }

            try
            {
                JSCompressorUtil.MergeAndCompressorJsonFiles(files, txtJsonCompress.Text);

                MessageBox.Show("合并压缩成功");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 点击JS压缩按钮
        /// </summary>
        /// <param name="sender">引发对象</param>
        /// <param name="e">事件参数</param>
        private void btnJsCompress_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(labJsFile.Text))
            {
                MessageBox.Show("请先选择JS文件");

                return;
            }

            try
            {
                JSCompressorUtil.CompressorFile(labJsFile.Text);

                MessageBox.Show("压缩成功");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }