System.Xml.XmlAutoDetectWriter.TextBlockCreatesWriter C# (CSharp) Method

TextBlockCreatesWriter() private method

If the specified text consist only of whitespace, then cache the whitespace, as it is not enough to force the creation of a wrapped writer. Otherwise, create a wrapped writer if one has not yet been created and return true.
private TextBlockCreatesWriter ( string textBlock ) : bool
textBlock string
return bool
        private bool TextBlockCreatesWriter(string textBlock) {
            if (this.wrapped == null) {
                // Whitespace-only text blocks aren't enough to determine Xml vs. Html
                if (XmlCharType.Instance.IsOnlyWhitespace(textBlock)) {
                    return false;
                }

                // Non-whitespace text block selects Xml method
                CreateWrappedWriter(XmlOutputMethod.Xml);
            }

            return true;
        }