PageRenderTime 313ms CodeModel.GetById 161ms app.highlight 1ms RepoModel.GetById 150ms app.codeStats 0ms

/Rhino.Etl.Core/DataReaders/Descriptor.cs

http://github.com/ayende/rhino-etl
C# | 41 lines | 15 code | 3 blank | 23 comment | 0 complexity | 1a5e8c3aaee81b7f44ef4b59502fcd02 MD5 | raw file
 1using System;
 2
 3namespace Rhino.Etl.Core
 4{
 5    /// <summary>
 6    /// Represent a virtual property, with a type and name. 
 7    /// It also exposes the ability to get the "property" from a container.
 8    /// </summary>
 9    /// <remarks>
10    /// This is needed because we want to use both types and untyped containers.
11    /// Those can be entities, hashtables, etc.
12    /// </remarks>
13    public abstract class Descriptor
14    {
15        /// <summary>
16        /// The name of this descriptor
17        /// </summary>
18        public string Name;
19        /// <summary>
20        /// The type fo this descriptor
21        /// </summary>
22        public Type Type;
23
24        /// <summary>
25        /// Initializes a new instance of the <see cref="Descriptor"/> class.
26        /// </summary>
27        /// <param name="name">The name.</param>
28        /// <param name="type">The type.</param>
29        public Descriptor(string name, Type type)
30        {
31            Name = name;
32            Type = type;
33        }
34
35        /// <summary>
36        /// Gets the value from the container
37        /// </summary>
38        /// <param name="container">The container.</param>
39        public abstract object GetValue(object container);
40    }
41}