예제 #1
0
파일: RDForm.cs 프로젝트: Truthkey/OpenKH
 private void Expthem(string dirTo, TreeNode tn, RDForm.UniName un)
 {
     while (this.p1.Controls.Count != 0)
     {
         this.p1.Controls[0].Dispose();
     }
     string dirn = un.Get(tn.Text);
     this.WavePlayer = delegate(RDForm.WAVi wi)
     {
         Directory.CreateDirectory(dirTo);
         File.WriteAllBytes(Path.Combine(dirTo, un.Get(dirn)), wi.w.bin);
     };
     this.treeView1.SelectedNode = tn;
     this.treeView1_AfterSelect(this.treeView1, new TreeViewEventArgs(tn, TreeViewAction.ByKeyboard));
     base.Update();
     this.WavePlayer = null;
     foreach (Control control in this.p1.Controls)
     {
         if (control is PictureBox)
         {
             Directory.CreateDirectory(dirTo);
             PictureBox pictureBox = (PictureBox)control;
             pictureBox.Image.Save(Path.Combine(dirTo, un.Get(dirn + ".png")), ImageFormat.Png);
         }
         if (control is TextBox)
         {
             Directory.CreateDirectory(dirTo);
             TextBox textBox = (TextBox)control;
             File.WriteAllText(Path.Combine(dirTo, un.Get(dirn + ".txt")), textBox.Text, Encoding.Default);
         }
         if (control is FlowLayoutPanel)
         {
             int num = 1;
             foreach (Control control2 in control.Controls)
             {
                 if (control2 is PictureBox)
                 {
                     Directory.CreateDirectory(dirTo);
                     PictureBox pictureBox2 = (PictureBox)control2;
                     pictureBox2.Image.Save(Path.Combine(dirTo, un.Get(string.Concat(new object[]
                     {
                         dirn,
                         "_",
                         num,
                         ".png"
                     }))), ImageFormat.Png);
                     num++;
                 }
             }
         }
     }
     RDForm.Hexi hexi = tn.Tag as RDForm.Hexi;
     if (hexi.len != 0)
     {
         Directory.CreateDirectory(dirTo);
         using (FileStream fileStream = File.Create(Path.Combine(dirTo, un.Get(dirn + ".bin"))))
         {
             fileStream.Write(this.rdbin, hexi.off, hexi.len);
             fileStream.Close();
         }
     }
     RDForm.UniName uniName = new RDForm.UniName();
     string path = uniName.Get(dirn);
     foreach (TreeNode tn2 in tn.Nodes)
     {
         this.Expthem(Path.Combine(dirTo, path), tn2, uniName);
     }
 }
예제 #2
0
파일: RDForm.cs 프로젝트: Truthkey/OpenKH
 private void Expall(TreeNodeCollection tnc, string dirTo)
 {
     foreach (TreeNode treeNode in tnc)
     {
         RDForm.UniName un = new RDForm.UniName();
         foreach (TreeNode tn in treeNode.Nodes)
         {
             this.Expthem(dirTo, tn, un);
         }
     }
 }