Skip to content

Commit ed6e061

Browse files
committed
Only bind logger to commands
1 parent 2fa8090 commit ed6e061

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

RetailCoder.VBE/Root/RubberduckModule.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class RubberduckModule : NinjectModule
4949
private const int MsForms = 17;
5050
private const int MsFormsControl = 18;
5151

52-
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
52+
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
5353

5454
public RubberduckModule(VBE vbe, AddIn addin)
5555
{
@@ -59,7 +59,7 @@ public RubberduckModule(VBE vbe, AddIn addin)
5959

6060
public override void Load()
6161
{
62-
_logger.Debug("in RubberduckModule.Load()");
62+
Logger.Debug("in RubberduckModule.Load()");
6363

6464
// bind VBE and AddIn dependencies to host-provided instances.
6565
Bind<VBE>().ToConstant(_vbe);
@@ -149,7 +149,7 @@ public override void Load()
149149
ConfigureProjectExplorerContextMenu();
150150

151151
BindWindowsHooks();
152-
_logger.Debug("completed RubberduckModule.Load()");
152+
Logger.Debug("completed RubberduckModule.Load()");
153153
}
154154

155155
private void BindWindowsHooks()
@@ -170,7 +170,7 @@ private void ApplyDefaultInterfacesConvention(IEnumerable<Assembly> assemblies)
170170
// inspections & factories have their own binding rules
171171
.Where(type => !type.Name.EndsWith("Factory") && !type.Name.EndsWith("ConfigProvider") && !type.GetInterfaces().Contains(typeof(IInspection)))
172172
.BindDefaultInterface()
173-
.Configure(binding => binding.InThreadScope().Intercept().With<FatalExceptionInterceptor>())); // TransientScope wouldn't dispose disposables
173+
.Configure(binding => binding.InThreadScope())); // TransientScope wouldn't dispose disposables
174174
}
175175

176176
// note: settings namespace classes are injected in singleton scope
@@ -308,7 +308,7 @@ private static int FindRubberduckMenuInsertionIndex(CommandBarControls controls,
308308
private void BindCommandsToMenuItems()
309309
{
310310
var types = Assembly.GetExecutingAssembly().GetTypes()
311-
.Where(type => type.IsClass && type.Namespace != null && type.Namespace.StartsWith(typeof(CommandBase).Namespace ?? String.Empty))
311+
.Where(type => type.IsClass && type.Namespace != null && type.Namespace.StartsWith(typeof(CommandBase).Namespace ?? string.Empty))
312312
.ToList();
313313

314314
// note: ICommand naming convention: [Foo]Command
@@ -330,10 +330,8 @@ private void BindCommandsToMenuItems()
330330
binding.WhenInjectedInto<RubberduckHooks>().BindingConfiguration.Condition;
331331

332332
binding.When(request => whenCommandMenuItemCondition(request) || whenHooksCondition(request))
333-
.InSingletonScope();
334-
335-
//Bind<ICommand>().To(command).WhenInjectedExactlyInto(item);
336-
//Bind<ICommand>().To(command);
333+
.InSingletonScope()
334+
.Intercept().With<FatalExceptionInterceptor>();
337335
}
338336
}
339337
catch (InvalidOperationException)

0 commit comments

Comments
 (0)