Skip to content

Commit c04519e

Browse files
committed
Sync with RD
2 parents dd2af3f + 4f8ac87 commit c04519e

File tree

196 files changed

+7566
-4613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+7566
-4613
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Branch | Description | Build Status |
1616
[nextBuildStatus]:https://ci.appveyor.com/api/projects/status/we3pdnkeebo4nlck/branch/next?svg=true
1717
[masterBuildStatus]:https://ci.appveyor.com/api/projects/status/we3pdnkeebo4nlck/branch/master?svg=true
1818

19-
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/rubberduck-vba/rubberduck.svg)](http://isitmaintained.com/project/rubberduck-vba/rubberduck "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/rubberduck-vba/rubberduck.svg)](http://isitmaintained.com/project/rubberduck-vba/rubberduck "Percentage of issues still open")
19+
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/rubberduck-vba/Rubberduck.svg)](http://isitmaintained.com/project/rubberduck-vba/Rubberduck "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/rubberduck-vba/Rubberduck.svg)](http://isitmaintained.com/project/rubberduck-vba/Rubberduck "Percentage of issues still open")
2020

2121
> **[rubberduckvba.com](http://rubberduckvba.com)** [Wiki](https://github.com/retailcoder/Rubberduck/wiki) [Rubberduck News](https://rubberduckvba.wordpress.com/)
2222
> contact@rubberduckvba.com

RetailCoder.VBE/Extension.cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
using Extensibility;
2-
using Ninject;
3-
using Ninject.Extensions.Factory;
4-
using Rubberduck.Root;
52
using Rubberduck.UI;
63
using System;
74
using System.ComponentModel;
@@ -13,9 +10,10 @@
1310
using System.Runtime.InteropServices;
1411
using System.Windows.Forms;
1512
using System.Windows.Threading;
13+
using Castle.Windsor;
1614
using Microsoft.Vbe.Interop;
17-
using Ninject.Extensions.Interception;
1815
using NLog;
16+
using Rubberduck.Root;
1917
using Rubberduck.Settings;
2018
using Rubberduck.SettingsProvider;
2119
using Rubberduck.VBEditor.Events;
@@ -41,7 +39,9 @@ public class _Extension : IDTExtensibility2
4139
private bool _isInitialized;
4240
private bool _isBeginShutdownExecuted;
4341

44-
private IKernel _kernel;
42+
private GeneralSettings _initialSettings;
43+
44+
private IWindsorContainer _container;
4545
private App _app;
4646
private readonly Logger _logger = LogManager.GetCurrentClassLogger();
4747

@@ -152,12 +152,12 @@ private void InitializeAddIn()
152152
};
153153
var configProvider = new GeneralConfigProvider(configLoader);
154154

155-
var settings = configProvider.Create();
156-
if (settings != null)
155+
_initialSettings = configProvider.Create();
156+
if (_initialSettings != null)
157157
{
158158
try
159159
{
160-
var cultureInfo = CultureInfo.GetCultureInfo(settings.Language.Code);
160+
var cultureInfo = CultureInfo.GetCultureInfo(_initialSettings.Language.Code);
161161
Dispatcher.CurrentDispatcher.Thread.CurrentUICulture = cultureInfo;
162162
}
163163
catch (CultureNotFoundException)
@@ -170,7 +170,7 @@ private void InitializeAddIn()
170170
}
171171

172172
Splash splash = null;
173-
if (settings.ShowSplash)
173+
if (_initialSettings.ShowSplash)
174174
{
175175
splash = new Splash
176176
{
@@ -210,10 +210,9 @@ private void Startup()
210210
currentDomain.UnhandledException += HandlAppDomainException;
211211
currentDomain.AssemblyResolve += LoadFromSameFolder;
212212

213-
_kernel = new StandardKernel(new NinjectSettings {LoadExtensions = true}, new FuncModule(), new DynamicProxyModule());
214-
_kernel.Load(new RubberduckModule(_ide, _addin));
215-
216-
_app = _kernel.Get<App>();
213+
_container = new WindsorContainer().Install(new RubberduckIoCInstaller(_ide, _addin, _initialSettings));
214+
215+
_app = _container.Resolve<App>();
217216
_app.Startup();
218217

219218
_isInitialized = true;
@@ -253,11 +252,11 @@ private void ShutdownAddIn()
253252
_app = null;
254253
}
255254

256-
if (_kernel != null)
255+
if (_container != null)
257256
{
258257
_logger.Log(LogLevel.Trace, "Disposing IoC container...");
259-
_kernel.Dispose();
260-
_kernel = null;
258+
_container.Dispose();
259+
_container = null;
261260
}
262261

263262
_isInitialized = false;

RetailCoder.VBE/Navigation/CodeExplorer/CodeExplorerViewModel.cs

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System.Diagnostics.CodeAnalysis;
45
using System.Globalization;
56
using System.Linq;
67
using NLog;
@@ -21,6 +22,7 @@
2122
using System.Windows;
2223

2324
// ReSharper disable CanBeReplacedWithTryCastAndCheckForNull
25+
// ReSharper disable ExplicitCallerInfoArgument
2426

2527
namespace Rubberduck.Navigation.CodeExplorer
2628
{
@@ -99,54 +101,45 @@ public CodeExplorerViewModel(FolderHelper folderHelper, RubberduckParserState st
99101

100102
SetNameSortCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), param =>
101103
{
102-
if ((bool)param == true)
104+
if ((bool)param)
103105
{
104106
SortByName = (bool)param;
105107
SortByCodeOrder = !(bool)param;
106108
}
107-
}, param =>
108-
{
109-
return SortByName ? false : true;
110-
});
109+
}, param => !SortByName);
111110

112111
SetCodeOrderSortCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), param =>
113112
{
114-
if ((bool)param == true)
113+
if ((bool)param)
115114
{
116115
SortByCodeOrder = (bool)param;
117116
SortByName = !(bool)param;
118-
};
119-
}, param =>
120-
{
121-
return SortByCodeOrder ? false : true;
122-
});
117+
}
118+
}, param => !SortByCodeOrder);
123119
}
124120

125121
private CodeExplorerItemViewModel _selectedItem;
126122
public CodeExplorerItemViewModel SelectedItem
127123
{
128-
get { return _selectedItem; }
124+
get => _selectedItem;
129125
set
130126
{
131127
_selectedItem = value;
132128
OnPropertyChanged();
133129

134-
// ReSharper disable ExplicitCallerInfoArgument
135130
OnPropertyChanged("CanExecuteIndenterCommand");
136131
OnPropertyChanged("CanExecuteRenameCommand");
137132
OnPropertyChanged("CanExecuteFindAllReferencesCommand");
138133
OnPropertyChanged("ExportVisibility");
139134
OnPropertyChanged("ExportAllVisibility");
140135
OnPropertyChanged("PanelTitle");
141136
OnPropertyChanged("Description");
142-
143-
// ReSharper restore ExplicitCallerInfoArgument
144137
}
145138
}
146139

147140
public bool SortByName
148141
{
149-
get { return _windowSettings.CodeExplorer_SortByName; }
142+
get => _windowSettings.CodeExplorer_SortByName;
150143
set
151144
{
152145
if (_windowSettings.CodeExplorer_SortByName == value)
@@ -166,7 +159,7 @@ public bool SortByName
166159

167160
public bool SortByCodeOrder
168161
{
169-
get { return _windowSettings.CodeExplorer_SortByCodeOrder; }
162+
get => _windowSettings.CodeExplorer_SortByCodeOrder;
170163
set
171164
{
172165
if (_windowSettings.CodeExplorer_SortByCodeOrder == value)
@@ -192,7 +185,7 @@ public bool SortByCodeOrder
192185

193186
public bool GroupByType
194187
{
195-
get { return _windowSettings.CodeExplorer_GroupByType; }
188+
get => _windowSettings.CodeExplorer_GroupByType;
196189
set
197190
{
198191
if (_windowSettings.CodeExplorer_GroupByType != value)
@@ -207,10 +200,22 @@ public bool GroupByType
207200
}
208201
}
209202

203+
private bool _canSearch;
204+
205+
public bool CanSearch
206+
{
207+
get => _canSearch;
208+
set
209+
{
210+
_canSearch = value;
211+
OnPropertyChanged();
212+
}
213+
}
214+
210215
private bool _isBusy;
211216
public bool IsBusy
212217
{
213-
get { return _isBusy; }
218+
get => _isBusy;
214219
set
215220
{
216221
_isBusy = value;
@@ -277,15 +282,17 @@ public string Description
277282
private ObservableCollection<CodeExplorerItemViewModel> _projects;
278283
public ObservableCollection<CodeExplorerItemViewModel> Projects
279284
{
280-
get { return _projects; }
285+
get => _projects;
281286
set
282287
{
283288
ReorderChildNodes(value);
284289
_projects = new ObservableCollection<CodeExplorerItemViewModel>(value.OrderBy(o => o.NameWithSignature));
285-
290+
CanSearch = _projects.Any();
291+
286292
OnPropertyChanged();
287293
// Once a Project has been set, show the TreeView
288294
OnPropertyChanged("TreeViewVisibility");
295+
OnPropertyChanged("CanSearch");
289296
}
290297
}
291298

RetailCoder.VBE/Root/EnumerableCounterInterceptor.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

RetailCoder.VBE/Root/InterceptedException.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

RetailCoder.VBE/Root/InterceptorBase.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)