Exemple #1
0
        // 非同期で呼び出されるメソッド
        private void AddItem(FindEntryInformation entry)
        {
            string[] catstr = { "arcs", "zips" };
            finditems.Add(entry);
            DataTable data = dataGridView.DataSource as DataTable;

            if (data != null)
            {
                DataRow  row     = data.NewRow();
                string[] content = { catstr[entry.category], entry.file, entry.path };
                row.ItemArray = content;
                data.Rows.Add(row);
            }
            if (firstdata)
            {
                firstdata = false;
#if false
                dataGridView.Columns[1].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
                dataGridView.Columns[2].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
#endif
            }
        }
Exemple #2
0
        public void Run()
        {
            TDCGExplorer.TDCGExplorer.IncBusy();
            ArcsDatabase arcDB = TDCGExplorer.TDCGExplorer.ArcsDB;
            // TAHを列挙する.
            List <ArcsTahEntry> tahs = arcDB.GetTahs();

            foreach (ArcsTahEntry tah in tahs)
            {
                TDCGExplorer.TDCGExplorer.SetToolTips("検索中:" + tah.shortname);
                if (HasString(tah.path, keyword))
                {
                    FindEntryInformation entry = new FindEntryInformation();
                    entry.category = 0; // arcs
                    entry.path     = String.Copy(tah.path);
                    entry.file     = Path.GetFileName(tah.path);
                    control.asyncDisplayFromArcs(entry);
                }
            }

            if (flagtahlevelsearch)
            {
                List <ArcsTahFilesEntry> files = arcDB.GetTahFilesPathHasString(keyword);
                foreach (ArcsTahFilesEntry file in files)
                {
                    ArcsTahEntry         tah   = arcDB.GetTah(file.tahid);
                    FindEntryInformation entry = new FindEntryInformation();
                    entry.category = 0; // arcs
                    entry.path     = String.Copy(tah.path);
                    entry.file     = String.Copy(file.GetDisplayPath());
                    control.asyncDisplayFromArcs(entry);
                }
            }

            if (flagzipsearch)
            {
                List <ArcsZipArcEntry> zips = arcDB.GetZips();
                foreach (ArcsZipArcEntry zip in zips)
                {
                    TDCGExplorer.TDCGExplorer.SetToolTips(TextResource.Searching + ":" + zip.GetDisplayPath());
                    if (HasString(zip.GetDisplayPath(), keyword))
                    {
                        FindEntryInformation entry = new FindEntryInformation();
                        entry.category = 1; //zips
                        entry.path     = String.Copy(Path.GetDirectoryName(zip.path) + "\\" + zip.GetDisplayPath());
                        entry.file     = zip.GetDisplayPath();
                        control.asyncDisplayFromArcs(entry);
                    }
                }
                //  LIKE文で総当たりする.
                List <ArcsZipTahEntry> ziptahs = arcDB.GetZipTahsHasString(keyword);
                foreach (ArcsZipTahEntry tah in ziptahs)
                {
                    ArcsZipArcEntry      subzip = arcDB.GetZip(tah.zipid);
                    FindEntryInformation entry  = new FindEntryInformation();
                    entry.category = 1; //zips
                    entry.path     = String.Copy(Path.GetDirectoryName(subzip.path) + "\\" + subzip.GetDisplayPath());
                    entry.file     = tah.shortname;
                    control.asyncDisplayFromArcs(entry);
                }
            }

            if (flagzipsearch && flagtahlevelsearch)
            {
                List <ArcsTahFilesEntry> files = arcDB.GetTahFilesPathHasString(keyword);
                foreach (ArcsTahFilesEntry file in files)
                {
                    ArcsZipTahEntry      tah   = arcDB.GetZipTah(file.tahid);
                    ArcsZipArcEntry      zip   = arcDB.GetZip(tah.zipid);
                    FindEntryInformation entry = new FindEntryInformation();
                    entry.category = 1; //zips
                    entry.path     = String.Copy(zip.path + "\\" + zip.GetDisplayPath());
                    entry.file     = String.Copy(file.GetDisplayPath());
                    control.asyncDisplayFromArcs(entry);
                }
            }

            // TBN辞書をセットして終了
            TDCGExplorer.TDCGExplorer.SetToolTips(TextResource.SearchComplete);
            TDCGExplorer.TDCGExplorer.DecBusy();
        }
Exemple #3
0
 // 非同期でツリー表示を更新する.
 public void asyncDisplayFromArcs(FindEntryInformation entry)
 {
     Invoke(new AddItemFromBGThread(AddItem), entry);
 }