コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SitemapWriter"/> class using
        /// the specified <see cref="XmlWriter"/> and site host URL.
        /// </summary>
        /// <param name="writer">The XmlWriter to write to.</param>
        /// <param name="siteHostUrl">The site host appended to the beginning of non-rooted URLs.</param>
        public SitemapWriter(XmlWriter writer, string siteHostUrl)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            ParameterUtils.ValidateStringNotNullOrEmpty(siteHostUrl, "siteHostUrl");

            if (siteHostUrl.IndexOf(':') == -1)
            {
                throw new ArgumentException("Invalid host url");
            }

            _writer      = writer;
            _siteHostUrl = siteHostUrl;
        }