My favorites | Sign in
Project Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#region License
//
// Author: Nate Kohari <nkohari@gmail.com>
// Copyright (c) 2007-2008, Enkari, Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion
#region Using Directives
using System;
using Ninject.Core;
using Ninject.Core.Selection;
using Ninject.Extensions.AutoWiring.Infrastructure;
#endregion

namespace Ninject.Extensions.AutoWiring
{
/// <summary>
/// Adds functionality to the kernel to support auto-wiring of dependencies.
/// </summary>
public class AutoWiringModule : StandardModule
{
/*----------------------------------------------------------------------------------------*/
/// <summary>
/// Loads the module into the kernel.
/// </summary>
public override void Load()
{
var selector = Kernel.Components.Get<IMemberSelector>();
var heuristics = selector.Heuristics;

heuristics.Clear();

heuristics.Add(new AutoWiringConstructorHeuristic());
heuristics.Add(new AutoWiringMethodHeuristic());
heuristics.Add(new AutoWiringPropertyHeuristic());
heuristics.Add(new AutoWiringFieldHeuristic());
}
/*----------------------------------------------------------------------------------------*/
}
}
Show details Hide details

Change log

r107 by nkohari on Aug 19, 2008   Diff
Added indirection in heuristics, will add
fluent interface soon for binding-specific
heuristics.
Removed binding directives in favor of new
heuristics system.
Go to: 
Project members, sign in to write a code review

Older revisions

r87 by nkohari on Jun 29, 2008   Diff
Added support for unloading modules.
[NINJECT-12]
Removed BeforeLoad/AfterLoad from
modules for simplicity; modules can
just load components during Load().
...
r67 by nkohari on May 25, 2008   Diff
Added auto-wiring extension.
Major refactoring to improve component
infrastructure and expose more
strategy-based extension points rather
than requiring inheritance.
...
r62 by nkohari on May 02, 2008   Diff
Added IProviderFactory and
IBindingFactory components to reduce
concerns of KernelBase & improve
extensibility
Refactored plugin-based factories for
...
All revisions of this file

File info

Size: 1728 bytes, 51 lines
Hosted by Google Code