FormEntry.cs 958 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using MPQ.FileSystem;
  10. using CommonUI_Unity3D.Src.M3Z;
  11. using System.IO;
  12. namespace MPQFileSystemTest
  13. {
  14. public partial class FormEntry : Form
  15. {
  16. public FormEntry(MPQFileSystem.MPQFileEntry e, MPQFileSystem fs)
  17. {
  18. InitializeComponent();
  19. this.Text = e.Key;
  20. if (e.Key.ToLower().EndsWith(".m3z"))
  21. {
  22. byte[] data = fs.getData(e.Key);
  23. using (MemoryStream stream = new MemoryStream(data))
  24. {
  25. M3ZHeader m3z = new M3ZHeader(stream);
  26. this.propertyGrid1.SelectedObject = m3z;
  27. }
  28. }
  29. else
  30. {
  31. this.propertyGrid1.SelectedObject = e;
  32. }
  33. }
  34. }
  35. }