Ejemplo n.º 1
0
        public TextPageControl(GenericTahInfo tahInfo)
            : base(tahInfo)
        {
            InitializeComponent();
            ExtractFile();
            textBox.SelectionStart  = 0;
            textBox.SelectionLength = 0;

            TDCGExplorer.TDCGExplorer.SetToolTips(tahInfo.path);
        }
Ejemplo n.º 2
0
 // zipファイルの中から
 public PoseFilePage(GenericTahInfo tahInfo) : base(tahInfo)
 {
     filename       = Path.GetFileName(tahInfo.path);
     Cursor.Current = Cursors.WaitCursor;
     try
     {
         InitializeComponent();
         ExtractFile();
         TDCGExplorer.TDCGExplorer.SetToolTips(Text);
     }
     catch (System.InvalidCastException ex)
     {
         Debug.WriteLine(ex.Message);
     }
     Cursor.Current = Cursors.Default;
 }
Ejemplo n.º 3
0
        // zipファイルの中から
        public SaveFilePage(GenericTahInfo tahInfo) : base(tahInfo)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                InitializeComponent();
                ExtractFile();
                dataGridView.AutoSizeColumnsMode   = DataGridViewAutoSizeColumnsMode.AllCells;
                dataGridView.ReadOnly              = true;
                dataGridView.MultiSelect           = false;
                dataGridView.SelectionMode         = DataGridViewSelectionMode.FullRowSelect;
                dataGridView.AllowUserToAddRows    = false;
                dataGridView.AllowUserToDeleteRows = false;

                TDCGExplorer.TDCGExplorer.SetToolTips(Text + " : " + TextResource.SearchComplete);
            }
            catch (System.InvalidCastException ex)
            {
                Debug.WriteLine(ex.Message);
            }
            Cursor.Current = Cursors.Default;
            filename       = Path.GetFileName(tahInfo.path);
        }
Ejemplo n.º 4
0
        public TAHPageControl(GenericTahInfo entryinfo, List <ArcsTahFilesEntry> filesentries)
        {
            InitializeComponent();

            info         = entryinfo;
            Text         = info.shortname + " version " + entryinfo.version.ToString();
            filesEntries = filesentries;

            DataTable data = new DataTable();

            data.Columns.Add("ID", Type.GetType("System.String"));
            data.Columns.Add(TextResource.Filename, Type.GetType("System.String"));
            data.Columns.Add(TextResource.FileType, Type.GetType("System.String"));
            data.Columns.Add(TextResource.HashCode, Type.GetType("System.String"));
            data.Columns.Add(TextResource.FileSize, Type.GetType("System.String"));
            data.Columns.Add(TextResource.Category, Type.GetType("System.String"));
            foreach (ArcsTahFilesEntry file in filesentries)
            {
                DataRow  row     = data.NewRow();
                string[] content = { file.tahentry.ToString(), file.GetDisplayPath(), Path.GetExtension(file.path), file.hash.ToString("x8"), file.length.ToString(), TDCGTbnUtil.GetCategoryText(file.GetDisplayPath()) };
                row.ItemArray = content;
                data.Rows.Add(row);
            }
            dataGridView.DataSource = data;

            dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;

            dataGridView.ReadOnly              = true;
            dataGridView.MultiSelect           = false;
            dataGridView.SelectionMode         = DataGridViewSelectionMode.FullRowSelect;
            dataGridView.AllowUserToAddRows    = false;
            dataGridView.AllowUserToDeleteRows = false;

            LoadPsdFile(0);

            TDCGExplorer.TDCGExplorer.SetToolTips(info.shortname + " : " + TextResource.TSOMessage);
        }
Ejemplo n.º 5
0
 public LoadTsoInfo(GenericTahInfo itinfo, ArcsTahFilesEntry itfile, int itid)
 {
     info = itinfo;
     file = itfile;
     id   = itid;
 }
Ejemplo n.º 6
0
        private void assembleTsoData()
        {
            foreach (LoadTsoInfo tsoload in loadtsoinfo)
            {
                GenericTahInfo    info = tsoload.info;
                ArcsTahFilesEntry file = tsoload.file;
                int id = tsoload.id;
                try
                {
                    // tso名を取得する.
                    string tsoname;
                    using (GenericTAHStream tahstream = new GenericTAHStream(info, file))
                    {
                        using (MemoryStream memorystream = new MemoryStream())
                        {
                            ZipFileUtil.CopyStream(tahstream.stream, memorystream);
                            tsoname = TDCGTbnUtil.GetTsoName(memorystream.ToArray());
                        }
                    }

                    GenericTahInfo    tsoinfo = null;
                    ArcsTahFilesEntry tso     = null;
                    if (info.zipid < 0)
                    {// Arcsの場合
                        int                      pastVersion = -1;
                        ArcsTahEntry             tahinfo     = null;
                        List <ArcsTahFilesEntry> tsos        = TDCGExplorer.TDCGExplorer.ArcsDB.GetTahFilesEntry(TAHUtil.CalcHash(tsoname));
                        foreach (ArcsTahFilesEntry subfile in tsos)
                        {
                            ArcsTahEntry subtah = TDCGExplorer.TDCGExplorer.ArcsDB.GetTah(subfile.tahid);
                            if (subtah.version > pastVersion)
                            {
                                tso         = subfile;
                                tahinfo     = subtah;
                                pastVersion = subtah.version;
                            }
                        }
                        tsoinfo = new GenericArcsTahInfo(tahinfo);
                    }
                    else
                    {// zipの場合
                        int                      pastVersion = -1;
                        ArcsZipTahEntry          tahinfo     = null;
                        List <ArcsTahFilesEntry> tsos        = TDCGExplorer.TDCGExplorer.ArcsDB.GetZipTahFilesEntries(TAHUtil.CalcHash(tsoname));
                        foreach (ArcsTahFilesEntry subfile in tsos)
                        {
                            ArcsZipTahEntry subtah = TDCGExplorer.TDCGExplorer.ArcsDB.GetZipTah(subfile.tahid);
                            if (subtah.version > pastVersion)
                            {
                                tso         = subfile;
                                tahinfo     = subtah;
                                pastVersion = subtah.version;
                            }
                        }
                        tsoinfo = new GenericZipsTahInfo(tahinfo);
                    }
                    if (tsoinfo != null && tso != null)
                    {
                        // TSOを読み込む
                        using (GenericTAHStream tahstream = new GenericTAHStream(tsoinfo, tso))
                        {
                            using (MemoryStream memorystream = new MemoryStream())
                            {
                                ZipFileUtil.CopyStream(tahstream.stream, memorystream);
                                PNGTsoData tsodata = new PNGTsoData();
                                tsodata.tsoID   = (uint)id;
                                tsodata.tsodata = memorystream.ToArray();
                                tsoDataList.Add(tsodata);
                            }
                        }
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Ejemplo n.º 7
0
        private void LoadTso(GenericTahInfo info, ArcsTahFilesEntry file, int id)
        {
            LoadTsoInfo tsoinfo = new LoadTsoInfo(info, file, id);

            loadtsoinfo.Add(tsoinfo);
        }
Ejemplo n.º 8
0
 public ImagePageControl(GenericTahInfo tahInfo) : base(tahInfo)
 {
     InitializeComponent();
     ExtractFile();
     TDCGExplorer.TDCGExplorer.SetToolTips(tahInfo.path + " : " + TextResource.ZoomByClick);
 }
Ejemplo n.º 9
0
 public ZipFilePageControl(GenericTahInfo tahInfo)
 {
     info = tahInfo;
     InitializeComponent();
     Text = Path.GetFileName(tahInfo.path);
 }
Ejemplo n.º 10
0
 public ZipFilePageControl()
 {
     info = null;
 }