Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public void Post()
        {
            if (isPosted)
            {
                return;
            }
            isPosted = true;

            scriptOutput.WriteRaw(blockOutput.GetString());
        }