Telerik.Web.Mvc.SiteMapHandler.WriteNode C# (CSharp) Method

WriteNode() private method

private WriteNode ( XmlWriter writer, System.Web.SiteMapNode node, System.Web.HttpContextBase httpContext, string applicationRoot ) : void
writer System.Xml.XmlWriter
node System.Web.SiteMapNode
httpContext System.Web.HttpContextBase
applicationRoot string
return void
        private void WriteNode(XmlWriter writer, SiteMapNode node, HttpContextBase httpContext, string applicationRoot)
        {
            if (node.IncludeInSearchEngineIndex)
            {
                string url = GetUrl(node, httpContext, applicationRoot);

                if (!string.IsNullOrEmpty(url))
                {
                    if (!duplicateChecks.ContainsKey(url))
                    {
                        writer.WriteStartElement("url", SiteMapNameSpace);
                        writer.WriteElementString("loc", SiteMapNameSpace, url);

                        if (node.LastModifiedAt.HasValue)
                        {
                            writer.WriteElementString("lastmod", SiteMapNameSpace, node.LastModifiedAt.Value.ToString("yyyy-MM-dd", Culture.Invariant));
                        }

                        if (node.ChangeFrequency != SiteMapChangeFrequency.Automatic)
                        {
                            writer.WriteElementString("changefreq", SiteMapNameSpace, node.ChangeFrequency.ToString().ToLower(Culture.Invariant));
                        }

                        if (node.UpdatePriority != SiteMapUpdatePriority.Automatic)
                        {
                            string priority = GetPriority(node);

                            writer.WriteElementString("priority", SiteMapNameSpace, priority);
                        }

                        writer.WriteEndElement();

                        duplicateChecks.Add(url, url);
                    }
                }
            }
        }