/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

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