protected override void Dispose(bool disposing) { if (savedata != null) { savedata.Close(); savedata.Dispose(); savedata = null; } if (savefilebitmap != null) { savefilebitmap.Dispose(); savefilebitmap = null; } if (savefile != null) { savefile.Dispose(); savefile = null; } base.Dispose(disposing); }
public override void BindingStream(MemoryStream ms) { ms.Seek(0, SeekOrigin.Begin); savefilebitmap = new Bitmap(ms); ms.Seek(0, SeekOrigin.Begin); savefile = new TDCGSaveFileInfo((Stream)ms); // セーブデータのコピーを保持する savedata = new MemoryStream(); ZipFileUtil.CopyStream(ms, savedata); #if false TDCGExplorer.TDCGExplorer.MainFormWindow.PictureBox.Image = savefilebitmap; TDCGExplorer.TDCGExplorer.MainFormWindow.PictureBox.Width = savefilebitmap.Width; TDCGExplorer.TDCGExplorer.MainFormWindow.PictureBox.Height = savefilebitmap.Height; #else TDCGExplorer.TDCGExplorer.MainFormWindow.SetBitmap(savefilebitmap); #endif DataTable data = new DataTable(); data.Columns.Add(TextResource.Parts, Type.GetType("System.String")); data.Columns.Add(TextResource.Category, Type.GetType("System.String")); data.Columns.Add(TextResource.TAHFile, Type.GetType("System.String")); for (int i = 0; i < TDCGSaveFileStatic.PARTS_SIZE; ++i) { string[] partfile = { savefile.GetPartsName(i), savefile.GetPartsFileName(i), "" }; // TAHファイルを検索する string partsname = savefile.GetPartsFileName(i); if (partsname.StartsWith("items/") == true) { if (TDCGExplorer.TDCGExplorer.SystemDB.findziplevel == false) { string partname = FindFromArcsTahs(partsname, i); if (partname != "") { partfile[2] = "arcs : " + partname; } } if (partfile[2] == "") { string partname = FindFromZipTahs(partsname, i); if (partname != "") { partfile[2] = "zips : " + partname; } } if (TDCGExplorer.TDCGExplorer.SystemDB.findziplevel == true && partfile[2] == "") { string partname = FindFromArcsTahs(partsname, i); if (partname != "") { partfile[2] = "arcs : " + partname; } } } DataRow row = data.NewRow(); row.ItemArray = partfile; data.Rows.Add(row); } for (int i = 0; i < TDCGSaveFileStatic.SLIDER_SIZE; ++i) { string[] partfile = { savefile.GetSliderName(i), savefile.GetSliderValue(i), "" }; DataRow row = data.NewRow(); row.ItemArray = partfile; data.Rows.Add(row); } dataGridView.DataSource = data; }