Beispiel #1
0
        /// <summary>
        /// Provides example code for the Save(Stream) method
        /// </summary>
        public static void SaveStreamExample()
        {
            ApmlDocument document = new ApmlDocument();

            //  Modify document state using public properties and methods

            using (Stream stream = new FileStream("ApmlDocument.xml", FileMode.Create, FileAccess.Write))
            {
                document.Save(stream);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Provides example code for the Save(XmlWriter) method
        /// </summary>
        public static void SaveXmlWriterExample()
        {
            ApmlDocument document = new ApmlDocument();

            //  Modify document state using public properties and methods

            using (Stream stream = new FileStream("ApmlDocument.xml", FileMode.Create, FileAccess.Write))
            {
                XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent = true;

                using (XmlWriter writer = XmlWriter.Create(stream, settings))
                {
                    document.Save(writer);
                }
            }
        }