Example #1
0
        private void button7_Click(object sender, EventArgs e)
        {
            this.Text = "转换中,请稍候";
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter           = "DIY卡数据文件 (diycards.dll)|diycards.dll|All files (*.*)|*.*";
            openFileDialog1.FilterIndex      = 0;
            openFileDialog1.RestoreDirectory = true;
            string dirpath = DB2Config.GetInstance().GetSetting("DeckPath") + "..\\";

            if (!Directory.Exists(dirpath))
            {
                dirpath = appPath + "\\Image\\";
            }
            if (!Directory.Exists(dirpath))
            {
                dirpath = appPath;
            }
            openFileDialog1.InitialDirectory = dirpath;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                setInProcess(true);
                CardsReader mReader     = new DIYReader();
                CardLibrary cardLibrary = new CardLibrary(mReader.Read(openFileDialog1.FileName, pbProcess, spStat));
                CardsSaver  lSaver      = new LuceneSaver();
                lSaver.Save("DIYCardIndex", cardLibrary.GetCards(), pbProcess, spStat);
                this.Text = "辅助转换工具";
                MessageBox.Show("索引建立完成!");
                setInProcess(false);
                pbProcess.Value = 0;
                spStat.Text     = "准备就绪";
            }
            this.Text = "辅助转换工具";
        }
Example #2
0
        private void button7_Click(object sender, EventArgs e)
        {
            string NBXDir = null;

            mAppInterface.GetAppDirEx(mAppInterface.AppName_NBX, ref NBXDir);
            string DIYPath = NBXDir + "\\data\\diycards.dll";

            this.Text = "数据读入中,请稍候";
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter           = "DIY卡数据文件 (diycards.dll)|diycards.dll|All files (*.*)|*.*";
            openFileDialog1.FilterIndex      = 0;
            openFileDialog1.RestoreDirectory = true;
            string dirpath = DB2Config.GetInstance().GetSetting("DeckPath") + "..\\";

            if (!Directory.Exists(dirpath))
            {
                dirpath = appPath + "\\Image\\";
            }
            if (!Directory.Exists(dirpath))
            {
                dirpath = appPath;
            }
            openFileDialog1.InitialDirectory = dirpath;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                CardsReader mReader     = new DIYReader();
                CardLibrary cardLibrary = new CardLibrary(mReader.Read(openFileDialog1.FileName, ProcessChanged));
                this.Text = "索引建立中,请稍候";
                CardsSaver lSaver = new LuceneSaver();
                lSaver.Save("DIYCardIndex", cardLibrary.GetCards(), ProcessChanged);
                this.Text = "辅助转换工具";
                MessageBox.Show("索引建立完成!");
            }
            this.Text = "辅助转换工具";
        }