//don't send extra records /// <summary> /// <inheritDoc/> /// /// </summary> public override IList <Redwood.Record> SignalEndTrack(int newDepth, long timeOfEnd) { //(pop info) OutputHandler.TrackInfo childInfo = this.info; if (childInfo == null) { throw new InvalidOperationException("OutputHandler received endTrack() without matching startTrack() --" + "are your handlers mis-configured?"); } if (trackStack.Empty()) { this.info = null; } else { this.info = this.trackStack.Pop(); this.info.numElementsPrinted += childInfo.numElementsPrinted; } //(handle track) if (this.queuedTracks.IsEmpty()) { StringBuilder b = new StringBuilder(); if (!this.missingOpenBracket) { //(write margin) for (int i = 0; i < this.leftMargin; i++) { b.Append(' '); } //(null content) WriteContent(newDepth, string.Empty, b); //(write bracket) b.Append("} "); } this.missingOpenBracket = false; //(write matching line) if (childInfo.numElementsPrinted > this.minLineCountForTrackNameReminder) { b.Append("<< ").Append(childInfo.name).Append(' '); } //(write time) if (timeOfEnd - childInfo.beginTime > 100) { b.Append('['); Redwood.FormatTimeDifference(timeOfEnd - childInfo.beginTime, b); b.Append(']'); } //(print) b.Append('\n'); Print(null, this.Style(new StringBuilder(), b.ToString(), trackColor, trackStyle).ToString()); } else { this.queuedTracks.RemoveLast(); } return(Empty); }
/// <summary> /// <inheritDoc/> /// /// </summary> public override IList <Redwood.Record> SignalStartTrack(Redwood.Record signal) { //(queue track) this.queuedTracks.AddLast(signal); //(push info) if (info != null) { this.trackStack.Push(info); } info = new OutputHandler.TrackInfo(signal.content.ToString(), signal.timesstamp); //(force print) if (signal.Force()) { UpdateTracks(signal.depth + 1); } //(return) return(Empty); }