public OutputChainBuffer(Sandbox sb, OutputChainBuffer prev, OutputChainBuffer targetOrigin) { _prevItem = prev; if (prev != null) { prev._nextItem = this; _caps = prev is OutputChainArticleBuffer && prev.Caps == Capitalization.First ? Capitalization.None : prev._caps; } _buffer = targetOrigin._buffer; sandbox = sb; }
public OutputChainBuffer(Sandbox sb, OutputChainBuffer prev) { _prevItem = prev; if (prev != null) { prev._nextItem = this; _caps = prev is OutputChainArticleBuffer && prev.Caps == Capitalization.First ? Capitalization.None : prev._caps; _numberFormatter.BinaryFormat = prev.NumberFormatter.BinaryFormat; _numberFormatter.BinaryFormatDigits = prev.NumberFormatter.BinaryFormatDigits; _numberFormatter.Endianness = prev.NumberFormatter.Endianness; _numberFormatter.NumberFormat = prev.NumberFormatter.NumberFormat; } _isTarget = true; _buffer = new StringBuilder(InitialCapacity); sandbox = sb; }
public OutputChain(Sandbox sb, string name) { sandbox = sb; _first = new OutputChainBuffer(sb, null); _last = _first; Name = name; }
public OutputChainBuffer AddArticleBuffer() { // If the last buffer is empty, just replace it. var b = _last = new OutputChainArticleBuffer(sandbox, _last); return(b); }
public void PrintToTarget(string targetName, string value) { OutputChainBuffer buffer; if (!targets.TryGetValue(targetName, out buffer)) { buffer = targets[targetName] = new OutputChainBuffer(sandbox, null); } buffer.Print(value); }
public void InsertTarget(string targetName) { // Check if the buffer was already created OutputChainBuffer buffer; if (!targets.TryGetValue(targetName, out buffer)) { // If not, make a new one and insert it buffer = targets[targetName] = AddBuffer(); } else { // If it does exist, just create a new instance of it with the same buffer and add it in. _last = new OutputChainBuffer(sandbox, _last, buffer); } // Then add an empty buffer after it so we don't start printing onto the target. AddBuffer(); }
public OutputChainBuffer AddArticleBuffer() { // If the last buffer is empty, just replace it. var b = _last = new OutputChainArticleBuffer(sandbox, _last); return b; }
public OutputChainBuffer AddBuffer() { return _last = new OutputChainBuffer(sandbox, _last); }
public OutputChainArticleBuffer(Sandbox sb, OutputChainBuffer prev, OutputChainBuffer targetOrigin) : base(sb, prev, targetOrigin) { Initialize(); }
public OutputChainBuffer AddBuffer() { return(_last = new OutputChainBuffer(sandbox, _last)); }
public OutputChainArticleBuffer(Sandbox sb, OutputChainBuffer prev) : base(sb, prev) { Initialize(); }