Skip to content

Commit

Permalink
Fixed SourceControl factory IoC bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
rubberduck203 committed Nov 22, 2015
1 parent a5c3c15 commit af2cf19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion RetailCoder.VBE/Root/RubberduckModule.cs
Expand Up @@ -95,7 +95,7 @@ private void ApplyAbstractFactoryConvention(IEnumerable<Assembly> assemblies)
{
_kernel.Bind(t => t.From(assemblies)
.SelectAllInterfaces()
.Where(type => type.Name.EndsWith("Factory"))
.Where(type => type.Name.EndsWith("Factory"))
.BindToFactory()
.Configure(binding => binding.InSingletonScope()));
}
Expand Down
10 changes: 5 additions & 5 deletions RetailCoder.VBE/UI/SourceControl/SourceControlBindings.cs
Expand Up @@ -2,6 +2,7 @@
using Ninject;
using Ninject.Modules;
using Rubberduck.Settings;
using Rubberduck.SourceControl;

namespace Rubberduck.UI.SourceControl
{
Expand Down Expand Up @@ -31,12 +32,11 @@ public override void Load()
Bind<IMergeView>().To<MergeForm>();

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

//Bind<ISourceControlProviderFactory>().To<SourceControlProviderFactory>();
//Bind<IFolderBrowserFactory>().To<DialogFactory>();
// note: RubberduckModule sets up factory proxies by convention.
// Replace these factory proxies with our existing concrete implementations.
Rebind<ISourceControlProviderFactory>().To<SourceControlProviderFactory>();
Rebind<IFolderBrowserFactory>().To<DialogFactory>();
}
}
}

0 comments on commit af2cf19

Please sign in to comment.