1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Fix filename for generic archive exporting

This commit is contained in:
KillzXGaming 2019-05-28 16:46:33 -04:00
parent 57c1af7022
commit d2db5c1c68
7 changed files with 4 additions and 28 deletions

Binary file not shown.

View File

@ -163,32 +163,6 @@ namespace FirstPlugin
} }
public override 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 override 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 static void ReplaceNode(TreeNode node, TreeNode replaceNode, TreeNode NewNode) public static void ReplaceNode(TreeNode node, TreeNode replaceNode, TreeNode NewNode)
{ {
if (NewNode == null) if (NewNode == null)

View File

@ -53,9 +53,11 @@ namespace Switch_Toolbox.Library
public virtual void Export() public virtual void Export()
{ {
string fileName = Path.GetFileName(FileName);
SaveFileDialog sfd = new SaveFileDialog(); SaveFileDialog sfd = new SaveFileDialog();
sfd.FileName = FileName; sfd.FileName = fileName;
sfd.DefaultExt = Path.GetExtension(FileName); sfd.DefaultExt = Path.GetExtension(fileName);
sfd.Filter = "Raw Data (*.*)|*.*"; sfd.Filter = "Raw Data (*.*)|*.*";
if (sfd.ShowDialog() == DialogResult.OK) if (sfd.ShowDialog() == DialogResult.OK)