PageRenderTime 61ms CodeModel.GetById 40ms app.highlight 2ms RepoModel.GetById 18ms app.codeStats 0ms

/src/LinFu.IoC/Configuration/NamedType.cs

http://github.com/philiplaureano/LinFu
C# | 59 lines | 28 code | 7 blank | 24 comment | 0 complexity | d4fbf7cac6955eedabcbb88cb83859eb MD5 | raw file
 1using System;
 2using System.Reflection;
 3using LinFu.IoC.Configuration.Interfaces;
 4
 5namespace LinFu.IoC.Configuration
 6{
 7    /// <summary>
 8    ///     Represents a named type.
 9    /// </summary>
10    public class NamedType : INamedType
11    {
12        /// <summary>
13        ///     Initializes a new instance of the <see cref="NamedType" /> class.
14        /// </summary>
15        public NamedType()
16        {
17        }
18
19        /// <summary>
20        ///     Initializes a new instance of the <see cref="NamedType" /> class.
21        /// </summary>
22        /// <param name="currentType">The current type.</param>
23        public NamedType(Type currentType)
24        {
25            Type = currentType;
26        }
27
28        /// <summary>
29        ///     Initializes a new instance of the <see cref="NamedType" /> class.
30        /// </summary>
31        /// <param name="parameter">The target parameter.</param>
32        public NamedType(ParameterInfo parameter)
33        {
34            Name = parameter.Name;
35            Type = parameter.ParameterType;
36        }
37
38        /// <summary>
39        ///     Initializes a new instance of the <see cref="NamedType" /> class.
40        /// </summary>
41        /// <param name="property">The target property.</param>
42        public NamedType(PropertyInfo property)
43        {
44            Name = property.Name;
45            Type = property.PropertyType;
46        }
47
48
49        /// <summary>
50        ///     Gets or sets a value indicating the name that will be associated with the current type.
51        /// </summary>
52        public string Name { get; set; }
53
54        /// <summary>
55        ///     Gets or sets the value indicating the current target type.
56        /// </summary>
57        public Type Type { get; set; }
58    }
59}