My favorites
|
Sign in
ninject
A lightweight, flexible, general purpose inversion-of-control container for .NET applications
Project Home
Downloads
Wiki
Issues
Source
Checkout
|
Browse
|
Changes
|
Changes to /trunk/src/Extensions/AutoWiring/AutoWiringModule.cs
r107 vs. r118
Edit
Compare:
r38
r62
r67
r87
r107
r118
vs.
r38
r62
r67
r87
r107
r118
Format:
Single-column
Side by side
‹r107
r118
Revision r118
Go to:
...Core/Activation/ActivatorBase.cs
...e/Activation/Context/IContext.cs
...ation/Context/IContextFactory.cs
...ation/Context/StandardContext.cs
...ontext/StandardContextFactory.cs
...Strategies/DisposableStrategy.cs
...tegies/FieldInjectionStrategy.cs
...egies/MethodInjectionStrategy.cs
.../Strategies/StartableStrategy.cs
...Behavior/OnePerThreadBehavior.cs
...ction/StandardBindingSelector.cs
...oviders/InjectionProviderBase.cs
...eation/Providers/ProviderBase.cs
...on/Providers/StandardProvider.cs
/trunk/src/Core/IKernel.cs
...tainer/ComponentContainerBase.cs
...Container/IComponentContainer.cs
...Container/IComponentShortcuts.cs
...omponents/KernelComponentBase.cs
.../Core/Infrastructure/ILocator.cs
...cture/Strategies/StrategyBase.cs
/trunk/src/Core/KernelBase.cs
/trunk/src/Core/Modules/Management
.../Management/IModuleCollection.cs
...les/Management/IModuleManager.cs
...agement/StandardModuleManager.cs
/trunk/src/Core/Ninject.Core.csproj
...tory/StandardDirectiveFactory.cs
...src/Core/Planning/PlannerBase.cs
...s/Base/ReflectionStrategyBase.cs
...ConstructorReflectionStrategy.cs
...egies/FieldReflectionStrategy.cs
...gies/MethodReflectionStrategy.cs
...es/PropertyReflectionStrategy.cs
...on/Resolvers/ProviderResolver.cs
/trunk/src/Core/StandardKernel.cs
...c/Core/Tracking/IScopeFactory.cs
...c/Core/Tracking/StandardScope.cs
...Core/Tracking/StandardTracker.cs
...s/AutoWiring/AutoWiringModule.cs
...utoWiringConstructorHeuristic.cs
...noRail/NinjectHttpApplication.cs
...onditionalInterceptionFixture.cs
...vation/GenericProviderFixture.cs
...ethodInjectionStrategyFixture.cs
...vation/StrategySupportFixture.cs
...s/Core/Binding/BindingFixture.cs
...erception/InterceptionFixture.cs
.../src/Tests/Core/ModuleFixture.cs
...geBroker/MessageBrokerFixture.cs
Project members,
sign in
to write a code review
/trunk/src/Extensions/AutoWiring/AutoWiringModule.cs
r107
/trunk/src/Extensions/AutoWiring/AutoWiringModule.cs
r118
1
#region License
1
#region License
2
//
2
//
3
// Author: Nate Kohari <nkohari@gmail.com>
3
// Author: Nate Kohari <nkohari@gmail.com>
4
// Copyright (c) 2007-2008, Enkari, Ltd.
4
// Copyright (c) 2007-2008, Enkari, Ltd.
5
//
5
//
6
// Licensed under the Apache License, Version 2.0 (the "License");
6
// Licensed under the Apache License, Version 2.0 (the "License");
7
// you may not use this file except in compliance with the License.
7
// you may not use this file except in compliance with the License.
8
// You may obtain a copy of the License at
8
// You may obtain a copy of the License at
9
//
9
//
10
// http://www.apache.org/licenses/LICENSE-2.0
10
// http://www.apache.org/licenses/LICENSE-2.0
11
//
11
//
12
// Unless required by applicable law or agreed to in writing, software
12
// Unless required by applicable law or agreed to in writing, software
13
// distributed under the License is distributed on an "AS IS" BASIS,
13
// distributed under the License is distributed on an "AS IS" BASIS,
14
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
// See the License for the specific language governing permissions and
15
// See the License for the specific language governing permissions and
16
// limitations under the License.
16
// limitations under the License.
17
//
17
//
18
#endregion
18
#endregion
19
#region Using Directives
19
#region Using Directives
20
using System;
20
using System;
21
using Ninject.Core;
21
using Ninject.Core;
22
using Ninject.Core.Selection;
22
using Ninject.Core.Selection;
23
using Ninject.Extensions.AutoWiring.Infrastructure;
23
using Ninject.Extensions.AutoWiring.Infrastructure;
24
#endregion
24
#endregion
25
25
26
namespace Ninject.Extensions.AutoWiring
26
namespace Ninject.Extensions.AutoWiring
27
{
27
{
28
/// <summary>
28
/// <summary>
29
/// Adds functionality to the kernel to support auto-wiring of dependencies.
29
/// Adds functionality to the kernel to support auto-wiring of dependencies.
30
/// </summary>
30
/// </summary>
31
public class AutoWiringModule : StandardModule
31
public class AutoWiringModule : StandardModule
32
{
32
{
33
/*----------------------------------------------------------------------------------------*/
33
/*----------------------------------------------------------------------------------------*/
34
/// <summary>
34
/// <summary>
35
/// Loads the module into the kernel.
35
/// Loads the module into the kernel.
36
/// </summary>
36
/// </summary>
37
public override void Load()
37
public override void Load()
38
{
38
{
39
var
selector
= Kernel.Components.
Get<I
MemberSelector
>();
39
var
heuristics
= Kernel.Components.MemberSelector.Heuristics;
40
var heuristics = selector
.Heuristics;
41
40
42
heuristics.Clear();
41
heuristics.Clear();
43
42
44
heuristics.Add(new AutoWiringConstructorHeuristic());
43
heuristics.Add(new AutoWiringConstructorHeuristic());
45
heuristics.Add(new AutoWiringMethodHeuristic());
44
heuristics.Add(new AutoWiringMethodHeuristic());
46
heuristics.Add(new AutoWiringPropertyHeuristic());
45
heuristics.Add(new AutoWiringPropertyHeuristic());
47
heuristics.Add(new AutoWiringFieldHeuristic());
46
heuristics.Add(new AutoWiringFieldHeuristic());
48
}
47
}
49
/*----------------------------------------------------------------------------------------*/
48
/*----------------------------------------------------------------------------------------*/
50
}
49
}
51
}
50
}
Hosted by