Beispiel #1
0
        private void localDirTextBox_TextChanged(object sender, EventArgs e)
        {
            return;

            string filepach = this.localDirTextBox.Text;

            AppCfg.setItem(AppCfg.localImgDir, filepach);
        }
Beispiel #2
0
        private void rootDirComboBoxSelectedChanged(object sender, EventArgs e)
        {
            this.listViewData.Items.Clear();
            this.listXlsx.Clear();
            int index = this.rootDirComboBox.SelectedIndex;

            AppCfg.setItem("selectIndex", index.ToString());
        }
Beispiel #3
0
        private void DownLoadImg_Load(object sender, EventArgs e)
        {
            this.initHotKey();
            string dir = AppCfg.getItem(AppCfg.localImgDir);

            if (dir != null)
            {
                this.localDirTextBox.Text = dir;
            }
        }
Beispiel #4
0
        private void localDirBtn_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dlg = new FolderBrowserDialog();

            dlg.Description = "请选择图片存放文件夹";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                string filepach = dlg.SelectedPath;//得到路径
                this.localDirTextBox.Text = filepach;
                AppCfg.setItem(AppCfg.localImgDir, filepach);
            }
            ;
        }
Beispiel #5
0
        public static EnumGenType genType       = EnumGenType.All;         // 生成的类型

        public static void init()
        {
            // 生成的类型
            string genType = AppCfg.getItem(AppCfg.genType);

            if (genType == null)
            {
                AppData.genType = EnumGenType.All;
            }
            else
            {
                AppData.genType = (EnumGenType)int.Parse(genType);
            }
        }
Beispiel #6
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            //更新标题: 工具的目录
            this.Text += " - exe: " + AppData.exePath;
            this.rootDirComboBox.Items.Add("-- 文件夹列表 --");

            AppData.init();
            //初始化文件夹下边的 数据
            this.InitDirectory();
            this.initGenTypeCombox();
            // listDir 处理
            if (this.rootListDir.Count > 0)
            {
                for (int i = 0; i < this.rootListDir.Count; i++)
                {
                    this.rootDirComboBox.Items.Add(this.rootListDir[i]);
                }
                // 加载上次保存的selectIndex
                string indexStr = AppCfg.getItem(AppCfg.selectIndex);
                int    index    = 0;
                if (indexStr != null)
                {
                    index = int.Parse(indexStr);
                }
                if (index > this.rootDirComboBox.Items.Count - 1)
                {
                    index = 0;
                }
                this.rootDirComboBox.SelectedIndex = index;
            }

            // bat 文件配置
            string cfgBatName = AppCfg.getItem(AppCfg.batFilePath);

            if (cfgBatName != null)
            {
                this.batPathTextBox.Text = cfgBatName;
            }
            // 隐藏窗口的定时器
            this.hideWinTimer.Start();
            //this.Top = 0;
        }
Beispiel #7
0
        // 选择bat文件
        private void selectBatBtn_Click(object sender, EventArgs e)
        {
            OpenFileDialog fileDlg = new OpenFileDialog();

            fileDlg.Title  = "请选择bat文件";
            fileDlg.Filter = "bat文件|*.bat|所有文件|*.*";
            string cfgBatPath = AppCfg.getItem("batPath");

            if (cfgBatPath == null)// 目录为空
            {
                // 去json目录找
                string path        = AppData.exePath;
                int    selectIndex = this.rootDirComboBox.SelectedIndex;
                if (selectIndex > 0)
                {
                    // 选中了目录文件
                    string dir = this.rootListDir[selectIndex - 1];
                    path = AppData.exePath + "\\" + dir + "\\json";
                }

                fileDlg.InitialDirectory = path;
            }
            else
            {
                fileDlg.InitialDirectory = cfgBatPath;
            }

            fileDlg.Multiselect = false;
            DialogResult result = fileDlg.ShowDialog();

            if (result == DialogResult.OK)
            {
                string filename = System.IO.Path.GetFileName(fileDlg.FileName);      //得到文件名
                string filepach = System.IO.Path.GetDirectoryName(fileDlg.FileName); //得到路径
                this.batPathTextBox.Text = fileDlg.FileName;
                AppCfg.setItem("batFile", fileDlg.FileName);
                AppCfg.setItem("batPath", filepach);
            }
        }
Beispiel #8
0
        // 保存配置
        public static void saveCfg()
        {
            int genType = (int)(AppData.genType);

            AppCfg.setItem(AppCfg.genType, genType.ToString());
        }
Beispiel #9
0
 public static void setGenType(EnumGenType type)
 {
     AppData.genType = type;
     AppCfg.setItem(AppCfg.genType, type.ToString());
 }