My favorites | Sign in
Project Logo
                
Changes to /trunk/src/Extensions/AutoWiring/AutoWiringModule.cs
r107 vs. r118   Edit
  Compare: vs.   Format:
Revision r118
Go to: 
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<IMemberSelector>(); 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 Google Code