コード例 #1
0
        private void selectIndex(int index)
        {
            ArcsCollisionRecord col = collisionEntry.entries[index];

            ArcsDatabase db = TDCGExplorer.TDCGExplorer.ArcsDB;
            // 衝突した先のtahを取得する.
            ArcsTahEntry from = db.GetTah(col.fromTahID);
            ArcsTahEntry to   = db.GetTah(col.toTahID);
            // 既に同じ名前で追加していないか調べる.
            ArcsTahFilesEntry fromfile = db.GetTahFilesEntry(col.fromFilesID);
            ArcsTahFilesEntry tofile   = db.GetTahFilesEntry(col.toFilesID);

            string text =
                @"<p>" +
                @"<h2> " + TextResource.CollisionHTML_CollisionFrom + " : " + from.shortname + "</h2>" +
                @"<adress>" + TextResource.Directory + " : " + Path.GetDirectoryName(from.path) + "</adress>" +
                @"<h3> " + TextResource.CollisionHTML_CollisionTo + " : " + to.shortname + "</h3>" +
                @"<adress>" + TextResource.Directory + " : " + Path.GetDirectoryName(to.path) + "</adress>" +
                @"<pre>" + fromfile.GetDisplayPath().ToLower() + " --> " + tofile.GetDisplayPath().ToLower() + "</pre>" +
                @"<pre>" + TextResource.HashCode + " : " + tofile.hash.ToString("x8") + "</pre>";

            webBrowser.DocumentText = text;

            try
            {
                string filename = fromfile.GetDisplayPath().ToLower();
                if (Path.GetExtension(filename) == ".tso")
                {
                    // TSOを表示する.
                    using (GenericTAHStream tahstream = new GenericTAHStream(new GenericArcsTahInfo(from), fromfile))
                    {
                        Cursor.Current = Cursors.WaitCursor;
                        TDCGExplorer.TDCGExplorer.MainFormWindow.makeTSOViwer();
                        TDCGExplorer.TDCGExplorer.MainFormWindow.clearTSOViewer();
                        TDCGExplorer.TDCGExplorer.MainFormWindow.Viewer.LoadTSOFile(tahstream.stream);
                        if (TDCGExplorer.TDCGExplorer.SystemDB.loadinitialpose)
                        {
                            TDCGExplorer.TDCGExplorer.MainFormWindow.doInitialTmoLoad();                                                    // 初期tmoを読み込む.
                        }
                        // カメラをセンター位置に.
                        TSOCameraAutoCenter camera = new TSOCameraAutoCenter(TDCGExplorer.TDCGExplorer.MainFormWindow.Viewer);
                        camera.UpdateCenterPosition(fromfile.path.ToUpper());
                        // 次回カメラが必ずリセットされる様にする.
                        TDCGExplorer.TDCGExplorer.MainFormWindow.setNeedCameraReset();
                        Cursor.Current = Cursors.Default;
                        //TDCGExplorer.TDCGExplorer.FigureLoad = false;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
コード例 #2
0
        public CollisionTahPageControl(CollisionItem argCollisionEntry)
        {
            InitializeComponent();
            collisionEntry = argCollisionEntry;
            Text           = Path.GetFileName(collisionEntry.tah.path);

            TDCGExplorer.TDCGExplorer.SetToolTips(Text);

            DataTable data = new DataTable();

            data.Columns.Add(TextResource.CollisionFrom, Type.GetType("System.String"));
            data.Columns.Add(TextResource.CollisionTo, Type.GetType("System.String"));
            data.Columns.Add(TextResource.CollisionedTAH, Type.GetType("System.String"));
            foreach (ArcsCollisionRecord col in collisionEntry.entries)
            {
                ArcsDatabase db = TDCGExplorer.TDCGExplorer.ArcsDB;
                // 衝突した先のtahを取得する.
                ArcsTahEntry to = db.GetTah(col.toTahID);
                // 既に同じ名前で追加していないか調べる.
                ArcsTahFilesEntry fromfile = db.GetTahFilesEntry(col.fromFilesID);
                ArcsTahFilesEntry tofile   = db.GetTahFilesEntry(col.toFilesID);
                DataRow           row      = data.NewRow();
                string[]          content  = { fromfile.GetDisplayPath(), tofile.GetDisplayPath().ToLower(), to.shortname };
                row.ItemArray = content;
                data.Rows.Add(row);
            }
            dataGridView.DataSource            = data;
            dataGridView.AutoSizeColumnsMode   = DataGridViewAutoSizeColumnsMode.AllCells;
            dataGridView.ReadOnly              = true;
            dataGridView.AllowUserToAddRows    = false;
            dataGridView.AllowUserToDeleteRows = false;

            selectIndex(0);
        }
コード例 #3
0
        private void toolStripMenuItemEditTah_Click(object sender, EventArgs e)
        {
            if (TDCGExplorer.TDCGExplorer.BusyTest() == true)
            {
                return;
            }

            ArcsCollisionRecord col  = collisionEntry.entries[0];
            ArcsDatabase        db   = TDCGExplorer.TDCGExplorer.ArcsDB;
            ArcsTahEntry        from = db.GetTah(col.fromTahID);

            LBFileTahUtl.OpenTahEditor(new GenericArcsTahInfo(from));
        }
コード例 #4
0
ファイル: TAHDump.cs プロジェクト: xvok16/TDCGExplorer
        public static void ArcsDumpDirEntries(string dir, ArcsDatabase db)
        {
            bool skipflag = false;

            string[] shortnames = dir.Split('\\');
            foreach (string shortname in shortnames)
            {
                if (shortname[0] == '!')
                {
                    skipflag = true;
                }
            }
            if (skipflag)
            {
                return;           // !で始まるディレクトリはスキップ
            }
            string[] tah_files = Directory.GetFiles(dir, "*.TAH");
            foreach (string file in tah_files)
            {
                // 既にdb上にエントリがあるか調べる.
                //string tahid = db.GetTahID(file.Substring(arcspath.Length + 1));
                ArcsTahEntry tah = db.GetTah(file.Substring(arcspath.Length + 1));
                if (tah != null)
                {
                    // 日付が一致するか?
                    DateTime datetime = File.GetLastWriteTime(file);
                    if (tah.datetime.ToString() == datetime.ToString())
                    {
                        // 該当するエントリの存在フラグを立てる.
                        TDCGExplorer.SetToolTips("Update " + Path.GetFileName(file));
                        db.UpdateTahExistUp(tah.id);
                        continue;
                    }
                    else
                    {
                        // dbから一旦削除する.
                        db.DeleteTah(tah.id);
                    }
                }
                TDCGExplorer.LastAccessFile = file;
                using (FileStream source = File.OpenRead(file))
                {
                    ArcsDumpTAHEntries(source, db, file);
                }
            }
            string[] entries = Directory.GetDirectories(dir);
            foreach (string entry in entries)
            {
                ArcsDumpDirEntries(entry, db);
            }
        }
コード例 #5
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();
        }