From 1997a40000b77bd3326cbc33672a7b9f78bb23f3 Mon Sep 17 00:00:00 2001 From: lucasg Date: Thu, 11 Nov 2021 12:59:18 +0100 Subject: [PATCH] [gui] Give a -depth option to the GUI --- DependenciesGui/App.config | 23 ++++-- DependenciesGui/DependencyWindow.xaml.cs | 9 ++- .../Properties/Settings.Designer.cs | 78 ++++++++++++------- DependenciesGui/Properties/Settings.settings | 25 ++++-- DependenciesGui/UserSettings.xaml | 26 ++++++- DependenciesGui/UserSettings.xaml.cs | 24 +++++- 6 files changed, 133 insertions(+), 52 deletions(-) diff --git a/DependenciesGui/App.config b/DependenciesGui/App.config index 067b2fb2..17613e1c 100644 --- a/DependenciesGui/App.config +++ b/DependenciesGui/App.config @@ -19,6 +19,18 @@ True + + 0 + + + peview.exe + + + ChildOnly + + + Courier New + - - peview.exe + + 2 - - ChildOnly - - - Courier New + + True diff --git a/DependenciesGui/DependencyWindow.xaml.cs b/DependenciesGui/DependencyWindow.xaml.cs index dd0dec3e..fe4599a5 100755 --- a/DependenciesGui/DependencyWindow.xaml.cs +++ b/DependenciesGui/DependencyWindow.xaml.cs @@ -1098,8 +1098,13 @@ private void ConstructDependencyTree(ModuleTreeViewItem RootNode, PE CurrentPE, } - // Process next batch of dll imports - if (SettingTreeBehaviour != TreeBuildingBehaviour.DependencyTreeBehaviour.ChildOnly) + // Process next batch of dll imports only if : + // 1. Recursive tree building has been activated + // 2. Recursion is not hitting the max depth level + bool doProcessNextLevel = (SettingTreeBehaviour != TreeBuildingBehaviour.DependencyTreeBehaviour.ChildOnly) && + (RecursionLevel < Dependencies.Properties.Settings.Default.TreeDepth); + + if (doProcessNextLevel) { foreach (var ImportNode in PEProcessingBacklog) { diff --git a/DependenciesGui/Properties/Settings.Designer.cs b/DependenciesGui/Properties/Settings.Designer.cs index e0f4684d..96de177f 100644 --- a/DependenciesGui/Properties/Settings.Designer.cs +++ b/DependenciesGui/Properties/Settings.Designer.cs @@ -71,21 +71,6 @@ public byte RecentFilesIndex { } } - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("\r\n\r\n \r\n \r\n \r\n \r\n \r\n")] - public global::System.Collections.Specialized.StringCollection RecentFiles { - get { - return ((global::System.Collections.Specialized.StringCollection)(this["RecentFiles"])); - } - set { - this["RecentFiles"] = value; - } - } - [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("peview.exe")] @@ -109,31 +94,64 @@ public string TreeBuildBehaviour { this["TreeBuildBehaviour"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("true")] - public bool BinaryCacheOptionValue - { - get - { - return ((bool)(this["BinaryCacheOptionValue"])); + [global::System.Configuration.DefaultSettingValueAttribute("Courier New")] + public string Font { + get { + return ((string)(this["Font"])); } - set - { - this["BinaryCacheOptionValue"] = value; + set { + this["Font"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("Courier New")] - public string Font { + [global::System.Configuration.DefaultSettingValueAttribute(@" + + + + + + + + + + + +")] + public global::System.Collections.Specialized.StringCollection RecentFiles { get { - return ((string)(this["Font"])); + return ((global::System.Collections.Specialized.StringCollection)(this["RecentFiles"])); } set { - this["Font"] = value; + this["RecentFiles"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("2")] + public int TreeDepth { + get { + return ((int)(this["TreeDepth"])); + } + set { + this["TreeDepth"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool BinaryCacheOptionValue { + get { + return ((bool)(this["BinaryCacheOptionValue"])); + } + set { + this["BinaryCacheOptionValue"] = value; } } } diff --git a/DependenciesGui/Properties/Settings.settings b/DependenciesGui/Properties/Settings.settings index 1344f9fc..7a6859e1 100644 --- a/DependenciesGui/Properties/Settings.settings +++ b/DependenciesGui/Properties/Settings.settings @@ -14,6 +14,15 @@ 0 + + peview.exe + + + ChildOnly + + + Courier New + <?xml version="1.0" encoding="utf-16"?> <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> @@ -22,16 +31,18 @@ <string /> <string /> <string /> + <string /> + <string /> + <string /> + <string /> + <string /> </ArrayOfString> - - peview.exe + + 2 - - ChildOnly - - - Courier New + + True \ No newline at end of file diff --git a/DependenciesGui/UserSettings.xaml b/DependenciesGui/UserSettings.xaml index 4a71e1e2..feaa33c6 100644 --- a/DependenciesGui/UserSettings.xaml +++ b/DependenciesGui/UserSettings.xaml @@ -25,6 +25,7 @@ + @@ -86,10 +87,27 @@ SelectedItem="{Binding Source={x:Static properties:Settings.Default}, Path=TreeBuildBehaviour, Mode=OneWay, Converter={StaticResource TreeBuildingBehaviourConverter}}" /> - + +