src/Misc/EFTools/XmlCore/Model/EFElement.cs
/// <summary>
///     Ensures the whitespace separation for the first child element added to a node.
/// </summary>
/// <param name="element"></param>
Ensures the whitespace separation for the first child element added to a node.
Ensures the whitespace separation for the first child element added to a node .
private void EnsureFirstNodeWhitespaceSeparation(XNode element)
        {
#if DEBUG
            if (element.Parent != null)
            {
                Debug.Assert(element.Parent.Elements().Count() == 1, "Unexpected count of elements!");
            }
            else
            {
                Debug.Assert(element.Document.Root == element, "element had null parent, but is not the root element of the document");
            }
#endif
            var precedingNewLine = new XText(Environment.NewLine + new string(' ', GetIndentLevel() * 2));
            var trailingNewLine = new XText(Environment.NewLine + new string(' ', Parent.GetIndentLevel() * 2));
            element.AddBeforeSelf(precedingNewLine);
            element.AddAfterSelf(trailingNewLine);
        }
private void EnsureFirstNodeWhitespaceSeparation ( XNode element ) { if DEBUG if ( element . Parent != null ) { Debug . Assert ( element . Parent . Elements ( ) . Count ( ) == 1 , " " ) ; } else { Debug . Assert ( element . Document . Root == element , " " ) ; } endif var precedingNewLine = new XText ( Environment . NewLine + new string ( ' ' , GetIndentLevel ( ) * 2 ) ) ; var trailingNewLine = new XText ( Environment . NewLine + new string ( ' ' , Parent . GetIndentLevel ( ) * 2 ) ) ; element . AddBeforeSelf ( precedingNewLine ) ; element . AddAfterSelf ( trailingNewLine ) ; }
Ensures the whitespace separation for the first child element added to a node.
Ensures the whitespace separation for the first child element added to a node .
// if first.Parent is null, then this is the root element in a document
element
XNode
None