public IWriteAnsi WriteBlock(Action <IWriteAnsi> writerAction) { if (writerAction == null) { throw new ArgumentNullException(nameof(writerAction)); } if (lockHandle == null) { throw new ApplicationException("LockHandle is undefined!"); } string text; using (var _writer = new ScriptOutput()) { writerAction.Invoke(_writer); _writer.Flush(); text = _writer.GetString(); } lock (lockHandle.Value) { writer.Flush(); builder.Append(text); } OnChanged(); return(this); }
public void Post() { if (isPosted) { return; } isPosted = true; scriptOutput.WriteRaw(blockOutput.GetString()); }