Пример #1
0
        /// <summary>
        /// Export a list of objects to file
        /// </summary>
        /// <param name="sw">Previously created TextWriter object</param>
        /// <param name="objects">A list of DBObjects</param>
        /// <param name="description">A string that will be used as heading comment before objects definitions</param>
        private static void Export(TextWriter sw, DBObject[] objects, string description)
        {
            sw.WriteLine("".PadRight(80, '-'));
            sw.WriteLine(String.Format("-- {0}", description));
            sw.WriteLine("".PadRight(80, '-'));
            sw.WriteLine();

            Array.ForEach(objects, o =>
            {
                o.WriteToStream(sw);
                sw.WriteLine();
            });
        }
Пример #2
0
 /// <summary>
 /// Export an object to file
 /// </summary>
 /// <param name="sw">Previously created TextWriter object</param>
 /// <param name="obj">A DBObject</param>
 /// <param name="desc">A string that will be used as heading comment before object definition</param>
 private static void Export(TextWriter sw, DBObject obj, string desc)
 {
     Export(sw, new DBObject[] { obj }, desc);
 }