/// <summary>
/// Collects the path of this <see cref="ParentedLogEntry"/>, optionally terminated with this entry.
/// </summary>
/// <param name="collector">Action for each item.</param>
/// <param name="addThis">Set it to true to append to also call the collector with this entry.</param>
public void CollectPath(Action <ParentedLogEntry> collector, bool addThis = false)
{
if (collector == null)
{
throw new ArgumentNullException("collector");
}
if (Parent != null)
{
Parent.DoGetPath(collector);
}
if (addThis)
{
collector(this);
}
}