1
0
mirror of synced 2025-01-31 04:13:51 +01:00

More fixes

This commit is contained in:
KillzXGaming 2019-06-16 20:48:17 -04:00
parent cd068828ba
commit e8283ac4ee
6 changed files with 10 additions and 6 deletions

Binary file not shown.

View File

@ -95,12 +95,13 @@ namespace Switch_Toolbox.Library.Forms
{
var Editor = ((TreeNodeFile)fileFormat).GetEditor();
var ActiveEditor = GetActiveEditor(Editor.GetType());
if (ActiveEditor != null)
if (ActiveEditor == null)
AddControl(Editor);
else
Editor = ActiveEditor;
((TreeNodeFile)fileFormat).FillEditor(Editor);
AddControl(Editor);
}
Type objectType = fileFormat.GetType();
@ -111,10 +112,10 @@ namespace Switch_Toolbox.Library.Forms
System.Reflection.MethodInfo method = objectType.GetMethod("OpenForm");
var Editor = (UserControl)method.Invoke(fileFormat, new object[0]);
var ActiveEditor = GetActiveEditor(Editor.GetType());
if (ActiveEditor != null)
if (ActiveEditor == null)
AddControl(Editor);
else
Editor = ActiveEditor;
AddControl(Editor);
}
}
}

View File

@ -110,12 +110,15 @@ namespace Switch_Toolbox.Library.Forms
AddNode(FileRoot);
}
//The process takes awhile atm so limit splitting if there's a high amount
private readonly int MAX_FILE_PATH_SPLIT = 5000;
void FillTreeNodes(TreeNode root, IArchiveFile archiveFile)
{
var rootText = root.Text;
var rootTextLength = rootText.Length;
var nodeFiles = archiveFile.Files;
if (nodeFiles.Count() > 400)
if (nodeFiles.Count() > MAX_FILE_PATH_SPLIT)
{
foreach (var node in nodeFiles)
{