Skip to content

Commit 7c40759

Browse files
author
slavara
committed
Merge branch 'hotfix/UI_OpenRecentFilesForm' into develop
2 parents bca1e84 + ee50594 commit 7c40759

File tree

2 files changed

+35
-16
lines changed

2 files changed

+35
-16
lines changed

QuickNavigate/Forms/TypeExplorerForm.cs

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ namespace QuickNavigate.Forms
1616
{
1717
public sealed partial class TypeExplorerForm : ClassModelExplorerForm
1818
{
19-
readonly List<string> closedTypes = new List<string>();
20-
readonly List<string> openedTypes = new List<string>();
21-
static readonly Dictionary<string, ClassModel> TypeToClassModel = new Dictionary<string, ClassModel>();
22-
readonly List<Button> filters = new List<Button>();
23-
readonly Dictionary<Keys, Button> keysToFilter = new Dictionary<Keys, Button>();
24-
readonly Dictionary<Button, string> filterToEnabledTip = new Dictionary<Button, string>();
25-
readonly Dictionary<Button, string> filterToDisabledTip = new Dictionary<Button, string>();
26-
readonly Dictionary<FlagType, Button> flagToFilter = new Dictionary<FlagType, Button>();
27-
28-
[CanBeNull]
29-
readonly Brush defaultNodeBrush;
19+
[NotNull] readonly List<string> closedTypes = new List<string>();
20+
[NotNull] readonly List<string> openedTypes = new List<string>();
21+
[NotNull] static readonly Dictionary<string, ClassModel> TypeToClassModel = new Dictionary<string, ClassModel>();
22+
[NotNull] readonly List<Button> filters = new List<Button>();
23+
[NotNull] readonly Dictionary<Keys, Button> keysToFilter = new Dictionary<Keys, Button>();
24+
[NotNull] readonly Dictionary<Button, string> filterToEnabledTip = new Dictionary<Button, string>();
25+
[NotNull] readonly Dictionary<Button, string> filterToDisabledTip = new Dictionary<Button, string>();
26+
[NotNull] readonly Dictionary<FlagType, Button> flagToFilter = new Dictionary<FlagType, Button>();
27+
[NotNull] readonly Timer timer = new Timer();
28+
[CanBeNull] readonly Brush defaultNodeBrush;
29+
private int filesCount;
3030

3131
/// <summary>
3232
/// Initializes a new instance of the QuickNavigate.Controls.TypeExplorer
@@ -42,14 +42,17 @@ public TypeExplorerForm(Settings settings) : base(settings)
4242
CreateItemsList();
4343
InitializeTree();
4444
RefreshTree();
45+
timer.Interval = PluginBase.MainForm.Settings.DisplayDelay;
46+
timer.Tick += OnTimerTick;
47+
timer.Start();
4548
}
4649

4750
[CanBeNull]
4851
ToolTip filterToolTip;
4952

5053
[CanBeNull]
5154
Button currentFilter;
52-
55+
5356
[CanBeNull]
5457
Button CurrentFilter
5558
{
@@ -86,6 +89,7 @@ protected override void Dispose(bool disposing)
8689
{
8790
defaultNodeBrush?.Dispose();
8891
components?.Dispose();
92+
timer.Dispose();
8993
}
9094
base.Dispose(disposing);
9195
}
@@ -194,7 +198,7 @@ static TypeNode CreateNode(string type)
194198
}
195199

196200
[NotNull]
197-
static IEnumerable<TypeNode> SortNodes(IEnumerable<TypeNode> nodes, string search)
201+
static IEnumerable<TypeNode> SortNodes([NotNull] IEnumerable<TypeNode> nodes, [NotNull] string search)
198202
{
199203
search = search.ToLower();
200204
var nodes0 = new List<TypeNode>();
@@ -311,6 +315,7 @@ protected override void OnKeyDown(KeyEventArgs e)
311315

312316
protected override void OnFormClosing(FormClosingEventArgs e)
313317
{
318+
timer.Stop();
314319
Settings.TypeExplorerSize = Size;
315320
Settings.TypeExplorerSearchExternalClassPath = searchingInExternalClasspaths.Checked;
316321
}
@@ -455,6 +460,17 @@ void OnFilterMouseLeave(object sender, EventArgs e)
455460

456461
void OnFilterMouseClick(object sender, EventArgs e) => CurrentFilter = filters.First(sender.Equals);
457462

463+
void OnTimerTick(object sender, EventArgs e)
464+
{
465+
var context = ASContext.GetLanguageContext(PluginBase.CurrentProject.Language);
466+
if (context == null || context.Classpath.Count == openedTypes.Count + closedTypes.Count) return;
467+
var filesCount = context.Classpath.Sum(it => it.FilesCount);
468+
if (filesCount == this.filesCount) return;
469+
this.filesCount = filesCount;
470+
CreateItemsList();
471+
RefreshTree();
472+
}
473+
458474
#endregion
459475
}
460476
}

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ Open Search in the topmenu.
1919

2020

2121
##### 1. Type Explorer:
22-
![image](https://cloud.githubusercontent.com/assets/576184/11501741/ed1b7008-9836-11e5-85d4-31e7062af9a3.png)
22+
![image](https://dl.dropboxusercontent.com/u/63456010/GitHub/QuickNavigate/TypeExplorer.gif)
2323

2424
##### 2. Quick Outline
25-
![image](https://cloud.githubusercontent.com/assets/576184/11501767/0318a150-9837-11e5-8165-81c8a303a3e2.png)
25+
![image](https://dl.dropboxusercontent.com/u/63456010/GitHub/QuickNavigate/QuickOutlineForm.gif)
2626

2727
##### 3. Class Hierarchy
28-
![image](https://cloud.githubusercontent.com/assets/576184/11501841/74c13808-9837-11e5-9772-936b31f57966.png)
28+
![image](https://dl.dropboxusercontent.com/u/63456010/GitHub/QuickNavigate/ClassHierarchy.gif)
2929

3030
##### 4. Recent files
31+
![Image](https://dl.dropboxusercontent.com/u/63456010/GitHub/QuickNavigate/OpenRecentFiles.gif)
32+
3133
##### 5. Recent projects
34+
![Image](https://dl.dropboxusercontent.com/u/63456010/GitHub/QuickNavigate/OpenRecentProjects.gif)

0 commit comments

Comments
 (0)