Implement DocumentWriter, control elements, and tests.

This commit is contained in:
Daniel Kraus
2015-07-25 14:33:48 +02:00
parent 659713abe3
commit 9df937138d
22 changed files with 722 additions and 151 deletions

View File

@ -31,7 +31,7 @@ namespace zaaReloaded2.Controller.Elements
/// to a Word document.
/// </summary>
[Serializable]
class Items : ElementBase
class Items : FormatElementBase
{
#region ElementBase implementation
@ -55,15 +55,13 @@ namespace zaaReloaded2.Controller.Elements
{
if (!String.IsNullOrEmpty(_caption))
{
formatter.Document.Range().InsertAfter(
String.Format("{0}: ", _caption)
);
formatter.Write(String.Format("{0}: ", _caption));
};
foreach (ItemFormatter i in items)
{
if (_needComma)
{
formatter.Document.Range().InsertAfter(", ");
formatter.Write(", ");
}
else
{
@ -71,6 +69,7 @@ namespace zaaReloaded2.Controller.Elements
}
i.WriteToDocument(formatter);
}
formatter.Write("\r");
}
}