Beispiel #1
0
        /// <summary>
        /// Write the whole dictionary to a stream with optional alphabetical sorting
        /// </summary>
        /// <param name="sw">The stream to write to</param>
        /// <param name="sortFirst">Whether the words should be sorted</param>
        public void WriteToStream(StreamWriter sw, bool sortFirst)
        {
            if (sortFirst)
            {
                Children.Sort(NodeSorter.GetInstance());
            }

            foreach (DictNode n in Children)
            {
                n.WriteToStream(sw, true);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Serialise the node as part of a full tree write
        /// </summary>
        /// <param name="sw">The stream to write to</param>
        /// <param name="sortFirst">True to alphabetically sort the child nodes first</param>
        public void WriteToStream(StreamWriter sw, bool sortFirst)
        {
            if (sortFirst)
            {
                Children.Sort(NodeSorter.GetInstance());
            }

            if (_isWord)
            {
                sw.WriteLine(this.ToString());
            }

            foreach (DictNode n in Children)
            {
                n.WriteToStream(sw, sortFirst);
            }
        }