Commands/frmInstallTheme.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Ionic.Zip;
using System.Threading;

namespace igcmd
{
    public partial class frmInstallTheme : Form
    {
        public frmInstallTheme()
        {
            InitializeComponent();
        }

        private void frmInstallTheme_Load(object sender, EventArgs e)
        {
            //cmd: iginstalltheme "srcFile"

            lblStatus.Text = "Installing ...";
            Thread t = new Thread(new ThreadStart(InstallTheme));
            t.Priority = ThreadPriority.BelowNormal;
            t.IsBackground = true;
            t.Start();
        }

        /// <summary>
        /// Cài đặt theme
        /// </summary>
        private void InstallTheme()
        {
            string file = Program.args[1];
            if (!File.Exists(file))
            {
                return;
            }

            Directory.CreateDirectory(Program.igPath + "Themes\\");

            using (ZipFile z = new ZipFile(file, Encoding.UTF8))
            {
                z.ExtractProgress += new EventHandler<ExtractProgressEventArgs>(z_ExtractProgress);
                z.ZipError += new EventHandler<ZipErrorEventArgs>(z_ZipError);

                z.ExtractAll(Program.igPath + "Themes\\", ExtractExistingFileAction.OverwriteSilently);
            };

        }

        void z_ZipError(object sender, ZipErrorEventArgs e)
        {
            picStatus.Image = igcmd.Properties.Resources._del_2;
            lblStatus.Text = "Theme error!";
        }

后面还有 22 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。