SerializeTo() public method

Utility method for serializing the report.
public SerializeTo ( Stream stream ) : void
stream System.IO.Stream The stream to write the report to.
return void
        /// <summary>
        /// Writes a complete XML status report to the given writer.
        /// </summary>
        /// <param name="writer">The writer to place the complete status report 
        /// to.</param>
        public virtual void Write(TextWriter writer)
        {
            Report report = new Report();

            report.Component = ReadComponents().ToArray();
            report.Service = GetServices().ToArray();

            report.SerializeTo(writer);
        }
        /// <summary>
        /// Writes the .ver file, and STatusConfiguration.xml for testing.
        /// </summary>
        /// <param name="component">The contents of the .ver file.</param>
        /// <param name="services">The contents of the StatusConfiguration.xml 
        /// file.</param>
        private void WriteFiles(Component component, List<Service> services = null)
        {
            #region PREPARES FOR THE TEST
            var statusConfig = new Report();
            if (services == null)
                services = new List<Service>();

            statusConfig.Service = services.ToArray();

            using (var writer = new StreamWriter(Path.Combine(SiteStatusDirectory, "Site.ver")))
            {
                component.SerializeTo(writer);
            }

            using (var writer = new StreamWriter(ConfigurationPath))
            {
                statusConfig.SerializeTo(writer);
            }
            #endregion
        }