Update editor properly.
This commit is contained in:
parent
bb691dcd0b
commit
afe0fc2e3f
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -18,17 +18,18 @@ namespace Switch_Toolbox.Library.Forms
|
|||||||
|
|
||||||
private bool _IsLoaded = false;
|
private bool _IsLoaded = false;
|
||||||
|
|
||||||
public ArchiveFilePanel(ArchiveFileInfo archiveFileInfo)
|
public ArchiveFilePanel()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
ArchiveFileInfo = archiveFileInfo;
|
|
||||||
|
|
||||||
ReloadEditors();
|
ReloadEditors();
|
||||||
|
|
||||||
_IsLoaded = true;
|
_IsLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void LoadFile(ArchiveFileInfo archiveFileInfo) {
|
||||||
|
ArchiveFileInfo = archiveFileInfo;
|
||||||
|
}
|
||||||
|
|
||||||
private void ReloadEditors()
|
private void ReloadEditors()
|
||||||
{
|
{
|
||||||
stComboBox1.Items.Clear();
|
stComboBox1.Items.Clear();
|
||||||
|
@ -85,13 +85,13 @@ namespace Switch_Toolbox.Library
|
|||||||
for (int i = 0; i < Files.Length; i++)
|
for (int i = 0; i < Files.Length; i++)
|
||||||
{
|
{
|
||||||
var File = ArchiveFileWrapper.FromPath(Files[i], archiveFile);
|
var File = ArchiveFileWrapper.FromPath(Files[i], archiveFile);
|
||||||
File.ArchiveFileInfo = new ArchiveFileInfo();
|
|
||||||
File.ArchiveFileInfo.FileData = System.IO.File.ReadAllBytes(Files[i]);
|
|
||||||
string FileName = Path.GetFileName(Files[i]);
|
string FileName = Path.GetFileName(Files[i]);
|
||||||
|
|
||||||
//Don't add the root file name
|
//Don't add the root file name
|
||||||
if (parentNode.FullPath != string.Empty || !(parentNode is ArchiveRootNodeWrapper))
|
if (parentNode.FullPath != string.Empty || !(parentNode is ArchiveRootNodeWrapper))
|
||||||
|
{
|
||||||
File.ArchiveFileInfo.FileName = Path.Combine(parentNode.FullPath, FileName);
|
File.ArchiveFileInfo.FileName = Path.Combine(parentNode.FullPath, FileName);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
File.ArchiveFileInfo.FileName = FileName;
|
File.ArchiveFileInfo.FileName = FileName;
|
||||||
|
|
||||||
|
@ -537,11 +537,12 @@ namespace Switch_Toolbox.Library
|
|||||||
ArchiveFilePanel editor = (ArchiveFilePanel)LibraryGUI.Instance.GetActiveContent(typeof(ArchiveFilePanel));
|
ArchiveFilePanel editor = (ArchiveFilePanel)LibraryGUI.Instance.GetActiveContent(typeof(ArchiveFilePanel));
|
||||||
if (editor == null)
|
if (editor == null)
|
||||||
{
|
{
|
||||||
editor = new ArchiveFilePanel(ArchiveFileInfo);
|
editor = new ArchiveFilePanel();
|
||||||
editor.Dock = DockStyle.Fill;
|
editor.Dock = DockStyle.Fill;
|
||||||
LibraryGUI.Instance.LoadEditor(editor);
|
LibraryGUI.Instance.LoadEditor(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
editor.LoadFile(ArchiveFileInfo);
|
||||||
editor.UpdateEditor();
|
editor.UpdateEditor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user