예제 #1
0
        private StringBuilderPool.ItemHolder      _builder; // Not readonly to avoid struct-copy on Dispose(), and to avoid VerificationException when medium-trust AppDomain

        public AppendBuilderCreator(StringBuilder appendTarget, bool mustBeEmpty)
        {
            _appendTarget = appendTarget;
            if (_appendTarget.Length > 0 && mustBeEmpty)
            {
                _builder = _builderPool.Acquire();
            }
            else
            {
                _builder = new StringBuilderPool.ItemHolder(_appendTarget, null, 0);
            }
        }