Esempio n. 1
0
 /// <summary>
 /// Writes a DocumentObjectCollection type object to a DDL file. Indent a new block by
 /// indent + initialIndent characters.
 /// </summary>
 public static void WriteToFile(DocumentObjectCollection docObjectContainer, string filename, int indent, int initialIndent)
 {
     using (var wrt = new DdlWriter(filename)
     {
         Indent = indent,
         InitialIndent = initialIndent
     })
     {
         wrt.WriteDocument(docObjectContainer);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Writes a DocumentObject type object to string. Indent a new block by indent + initialIndent characters.
        /// </summary>
        public static string WriteToString(DocumentObject docObject, int indent, int initialIndent)
        {
            StringBuilder strBuilder = new StringBuilder();

            using (var writer = new StringWriter(strBuilder))
            {
                using (var wrt = new DdlWriter(writer)
                {
                    Indent = indent,
                    InitialIndent = initialIndent
                })
                    wrt.WriteDocument(docObject);
            }
            return(strBuilder.ToString());
        }
Esempio n. 3
0
        /// <summary>
        /// Writes a DocumentObjectCollection type object to string. Indent a new block by
        /// indent + initialIndent characters.
        /// </summary>
        public static string WriteToString(DocumentObjectCollection docObjectContainer, int indent, int initialIndent)
        {
            var sb = new StringBuilder();

            using (var writer = new StringWriter(sb))
            {
                using (var wrt = new DdlWriter(writer)
                {
                    Indent = indent,
                    InitialIndent = initialIndent
                })
                {
                    wrt.WriteDocument(docObjectContainer);
                }
            }
            return(sb.ToString());
        }