Mercurial > pub > bltoolkit
diff Source/Mapping/TextDataMapper.cs @ 0:f990fcb411a9
Копия текущей версии из github
author | cin |
---|---|
date | Thu, 27 Mar 2014 21:46:09 +0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Source/Mapping/TextDataMapper.cs Thu Mar 27 21:46:09 2014 +0400 @@ -0,0 +1,45 @@ +using System; + +namespace BLToolkit.Mapping +{ + public class TextDataMapper : MapDataDestinationBase + { + public TextDataMapper(TextDataWriter writer) + { + if (writer == null) throw new ArgumentNullException("writer"); + + _writer = writer; + } + + private readonly TextDataWriter _writer; + public TextDataWriter Writer + { + get { return _writer; } + } + + public virtual void WriteEnd() + { + _writer.WriteEnd(); + } + + public override Type GetFieldType(int index) + { + return _writer.GetFieldType(index); + } + + public override int GetOrdinal(string name) + { + return _writer.GetOrdinal(name); + } + + public override void SetValue(object o, int index, object value) + { + _writer.SetValue(index, value); + } + + public override void SetValue(object o, string name, object value) + { + _writer.SetValue(name, value); + } + } +}