Example #1
0
        public void ExtractFile()
        {
            if (info.zipid != -1)
            {
                ArcsZipArcEntry zipEntry  = TDCGExplorer.GetArcsDatabase().GetZip(info.zipid);
                string          zipsource = Path.Combine(TDCGExplorer.GetSystemDatabase().zips_path, zipEntry.path);
                switch (Path.GetExtension(zipEntry.path.ToLower()))
                {
                case ".zip":
                    using (IArchive arc = new ZipArchive())
                    {
                        ExtractFile(arc, zipsource);
                    }
                    break;

                case ".rar":
                    using (IArchive arc = new RarArchive())
                    {
                        ExtractFile(arc, zipsource);
                    }
                    break;

                case ".lzh":
                    using (IArchive arc = new LzhArchive())
                    {
                        ExtractFile(arc, zipsource);
                    }
                    break;

                default:
                    break;
                }
            }
        }
Example #2
0
        public void DoWorkerThread()
        {
            string  moddb = TDCGExplorer.GetSystemDatabase().moddb_url;
            string  relurl;
            ArcRels relationships;

            string msg = "<html><body>";

            int count = 0;

            //            Cursor.Current = Cursors.WaitCursor;
            try
            {
                relurl = moddb + "arcs/code/" + zipEntry.code + "/rels.xml";
                TDCGExplorer.SetToolTips(relurl);
                relationships = ArcRels.Load(relurl);

                Arc thisarc = Arc.Load(moddb + "arcs/code/" + zipEntry.code + ".xml");

                msg += "<h2><a href=" + moddb + "arcs/" + thisarc.Id + ">" + "MOD Archive code:" + zipEntry.code + "</a></h2>";

                if (relationships != null)
                {
                    if (relationships.Relationships != null)
                    {
                        foreach (Relationship relation in relationships.Relationships)
                        {
                            string   arcurl  = moddb + "arcs/" + relation.ToId.ToString() + ".xml";
                            string[] kindstr = { "0", "同一内容", "新版", "前提" };
                            try
                            {
                                Arc arc = Arc.Load(arcurl);
                                if (arc != null)
                                {
                                    msg += "<pre>";
                                    msg += "属性:" + kindstr[relation.Kind] + "<br/>";
                                    msg += "MODコード名:" + arc.Code + "<br/>";
                                    msg += "サマリー:" + arc.Summary + "<br/>";
                                    msg += "元ファイル名:" + arc.Origname + "<br/>";
                                    msg += "拡張子:" + arc.Extname + "<br/>";
                                    msg += "所在:" + arc.Location + "<br/>";
                                    msg += "</pre>";
                                    count++;
                                }
                            }
                            catch (Exception ex)
                            {
                                Debug.WriteLine(ex.Message);
                            }
                        }
                    }
                }

                relurl        = moddb + "arcs/code/" + zipEntry.code + "/revs.xml";
                relationships = ArcRels.Load(relurl);
                if (relationships != null)
                {
                    if (relationships.Relationships != null)
                    {
                        foreach (Relationship relation in relationships.Relationships)
                        {
                            if (relation.Kind == 1)
                            {
                                continue;
                            }
                            string   arcurl  = moddb + "arcs/" + relation.FromId.ToString() + ".xml";
                            string[] kindstr = { "0", "1", "旧版", "提供" };
                            try
                            {
                                Arc arc = Arc.Load(arcurl);
                                if (arc != null)
                                {
                                    msg += "<pre>";
                                    msg += "属性:" + kindstr[relation.Kind] + "<br/>";
                                    msg += "MODコード名:" + arc.Code + "<br/>";
                                    msg += "サマリー:" + arc.Summary + "<br/>";
                                    msg += "元ファイル名:" + arc.Origname + "<br/>";
                                    msg += "拡張子:" + arc.Extname + "<br/>";
                                    msg += "所在:" + arc.Location + "<br/>";
                                    msg += "</pre>";
                                    count++;
                                }
                            }
                            catch (Exception ex)
                            {
                                Debug.WriteLine(ex.Message);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
            //            Cursor.Current = Cursors.Default;

            if (count == 0)
            {
                msg += "<p>関連情報がありません</p>";
            }
            msg += "</body></html>";
            page.asyncDisplayFromArcs(msg);
        }