Skip to content

Commit da56440

Browse files
committed
Merge pull request #852 from ckuhn203/next
Fixed SourceControl factory IoC bindings
2 parents 8ecb682 + af2cf19 commit da56440

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

RetailCoder.VBE/Root/RubberduckModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private void ApplyAbstractFactoryConvention(IEnumerable<Assembly> assemblies)
9595
{
9696
_kernel.Bind(t => t.From(assemblies)
9797
.SelectAllInterfaces()
98-
.Where(type => type.Name.EndsWith("Factory"))
98+
.Where(type => type.Name.EndsWith("Factory"))
9999
.BindToFactory()
100100
.Configure(binding => binding.InSingletonScope()));
101101
}

RetailCoder.VBE/UI/SourceControl/SourceControlBindings.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Ninject;
33
using Ninject.Modules;
44
using Rubberduck.Settings;
5+
using Rubberduck.SourceControl;
56

67
namespace Rubberduck.UI.SourceControl
78
{
@@ -31,12 +32,11 @@ public override void Load()
3132
Bind<IMergeView>().To<MergeForm>();
3233

3334
//factories
34-
// todo: check on note below
35-
// ninject is complaining about also having a SourceControlProviderFactoryProxy and a FolderBrowserFactoryProxy
36-
// I'm unsure about commenting these out. I have a feeling that it's not the "right thing", but everything seems to work.
3735

38-
//Bind<ISourceControlProviderFactory>().To<SourceControlProviderFactory>();
39-
//Bind<IFolderBrowserFactory>().To<DialogFactory>();
36+
// note: RubberduckModule sets up factory proxies by convention.
37+
// Replace these factory proxies with our existing concrete implementations.
38+
Rebind<ISourceControlProviderFactory>().To<SourceControlProviderFactory>();
39+
Rebind<IFolderBrowserFactory>().To<DialogFactory>();
4040
}
4141
}
4242
}

0 commit comments

Comments
 (0)