More work on Formatter; successful tests.

This commit is contained in:
Daniel Kraus
2015-07-14 23:19:41 +02:00
parent c43b0af1e3
commit b810cc8a74
9 changed files with 117 additions and 49 deletions

View File

@ -40,6 +40,11 @@ namespace zaaReloaded2.Formatter
/// </summary>
public ElementsList Elements { get; private set; }
/// <summary>
/// Gets the working Word document.
/// </summary>
public Document Document { get; private set; }
/// <summary>
/// Gets or sets the style of the normal range reference.
/// </summary>
@ -67,6 +72,11 @@ namespace zaaReloaded2.Formatter
}
}
/// <summary>
/// Gets the current working set of TimePointFormatters.
/// </summary>
public ITimePointFormatterDictionary WorkingTimePoints { get; private set; }
#endregion
#region Constructor
@ -76,6 +86,12 @@ namespace zaaReloaded2.Formatter
Elements = new ElementsList();
}
public Formatter(Document document)
: this()
{
Document = document;
}
#endregion
#region Public methods
@ -85,8 +101,13 @@ namespace zaaReloaded2.Formatter
/// </summary>
/// <param name="document">Word document to write to (at the
/// current position of the cursor).</param>
public void WriteToDocument(Document document)
public void Run()
{
WorkingTimePoints = _timePointFormatters;
foreach (ElementBase element in Elements)
{
element.Run(this);
}
}
#endregion