Create new namespace zaaReloaded2.Formatter, move settings there.
This commit is contained in:
@ -19,37 +19,28 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.Office.Interop.Word;
|
||||
using zaaReloaded2.Formatter.Elements;
|
||||
using zaaReloaded2.LabModel;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.Office.Interop.Word;
|
||||
using zaaReloaded2.LabModel;
|
||||
using zaaReloaded2.Controller;
|
||||
using zaaReloaded2.Controller.Elements;
|
||||
|
||||
namespace zaaReloaded2.Formatter
|
||||
{
|
||||
/// <summary>
|
||||
/// Formats and writes a <see cref="Laboratory"/> to a Word document.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
class Formatter
|
||||
public class Formatter
|
||||
{
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of formatting elements (derived from
|
||||
/// <see cref="ElementBase"/>).
|
||||
/// </summary>
|
||||
public ElementsList Elements { get; private set; }
|
||||
public Settings Settings { get; 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>
|
||||
public ReferenceStyle ReferenceStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="Laboratory"/> that shall be
|
||||
/// formatted.
|
||||
@ -67,7 +58,8 @@ namespace zaaReloaded2.Formatter
|
||||
_timePointFormatters = new TimePointFormatterDictionary();
|
||||
foreach (TimePoint tp in _laboratory.TimePoints.Values)
|
||||
{
|
||||
_timePointFormatters[tp.TimeStamp] = new TimePointFormatter(tp, ReferenceStyle);
|
||||
_timePointFormatters[tp.TimeStamp] =
|
||||
new TimePointFormatter(tp, Settings.ReferenceStyle);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -83,7 +75,7 @@ namespace zaaReloaded2.Formatter
|
||||
|
||||
public Formatter()
|
||||
{
|
||||
Elements = new ElementsList();
|
||||
Settings = new Settings();
|
||||
}
|
||||
|
||||
public Formatter(Document document)
|
||||
@ -104,7 +96,7 @@ namespace zaaReloaded2.Formatter
|
||||
public void Run()
|
||||
{
|
||||
WorkingTimePoints = _timePointFormatters;
|
||||
foreach (ElementBase element in Elements)
|
||||
foreach (ElementBase element in Settings.Elements)
|
||||
{
|
||||
element.Run(this);
|
||||
}
|
||||
|
Reference in New Issue
Block a user