1
0
mirror of synced 2024-09-24 11:38:22 +02:00

Add functions to export data properly for generic archives

This commit is contained in:
KillzXGaming 2019-05-28 16:43:57 -04:00
parent 6999a6debf
commit 57c1af7022
4 changed files with 25 additions and 2 deletions

Binary file not shown.

View File

@ -38,8 +38,31 @@ namespace Switch_Toolbox.Library
public FileType FileDataType = FileType.Default;
public virtual void Replace() { }
public virtual void Export() { }
public virtual void Replace()
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.FileName = FileName;
ofd.DefaultExt = Path.GetExtension(FileName);
ofd.Filter = "Raw Data (*.*)|*.*";
if (ofd.ShowDialog() == DialogResult.OK)
{
FileData = File.ReadAllBytes(ofd.FileName);
}
}
public virtual void Export()
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.FileName = FileName;
sfd.DefaultExt = Path.GetExtension(FileName);
sfd.Filter = "Raw Data (*.*)|*.*";
if (sfd.ShowDialog() == DialogResult.OK)
{
File.WriteAllBytes(sfd.FileName, FileData);
}
}
public string GetSize()
{