Beispiel #1
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();
        }