|
9 | 9 | using Castle.MicroKernel.Resolvers.SpecializedResolvers;
|
10 | 10 | using Castle.MicroKernel.SubSystems.Configuration;
|
11 | 11 | using Castle.Windsor;
|
12 |
| -using Rubberduck.AddRemoveReferences; |
13 | 12 | using Rubberduck.ComClientLibrary.UnitTesting;
|
14 | 13 | using Rubberduck.Common;
|
15 | 14 | using Rubberduck.Common.Hotkeys;
|
|
54 | 53 | using Rubberduck.Parsing.VBA.DeclarationCaching;
|
55 | 54 | using Rubberduck.Parsing.VBA.Parsing.ParsingExceptions;
|
56 | 55 | using Rubberduck.UI.AddRemoveReferences;
|
| 56 | +using Rubberduck.UI.Settings; |
| 57 | +using GeneralSettings = Rubberduck.Settings.GeneralSettings; |
| 58 | +using IndenterSettings = Rubberduck.SmartIndenter.IndenterSettings; |
57 | 59 |
|
58 | 60 | namespace Rubberduck.Root
|
59 | 61 | {
|
@@ -124,6 +126,7 @@ public void Install(IWindsorContainer container, IConfigurationStore store)
|
124 | 126 | .ImplementedBy<VBEInteraction>()
|
125 | 127 | .LifestyleSingleton());
|
126 | 128 |
|
| 129 | + RegisterSettingsViewModel(container); |
127 | 130 | RegisterRefactoringDialogs(container);
|
128 | 131 |
|
129 | 132 | container.Register(Component.For<ISearchResultsWindowViewModel>()
|
@@ -613,6 +616,23 @@ private Type[] ToolsMenuItems()
|
613 | 616 | return items.ToArray();
|
614 | 617 | }
|
615 | 618 |
|
| 619 | + private void RegisterSettingsViewModel(IWindsorContainer container) |
| 620 | + { |
| 621 | + container.Register(Types |
| 622 | + .FromAssemblyInThisApplication() |
| 623 | + .IncludeNonPublicTypes() |
| 624 | + .BasedOn(typeof(SettingsViewModelBase<>)) |
| 625 | + .LifestyleTransient() |
| 626 | + .WithServiceSelect((type, types) => |
| 627 | + { |
| 628 | + var face = type.GetInterfaces().FirstOrDefault(i => |
| 629 | + i.IsGenericType && i.GetGenericTypeDefinition() == typeof(ISettingsViewModel<>)); |
| 630 | + |
| 631 | + return face == null ? new[] { type } : new[] { type, face }; |
| 632 | + }) |
| 633 | + ); |
| 634 | + } |
| 635 | + |
616 | 636 | private void RegisterRefactoringDialogs(IWindsorContainer container)
|
617 | 637 | {
|
618 | 638 | container.Register(Component.For<IRefactoringDialog<RenameViewModel>>()
|
|
0 commit comments