AJH.CMS.WEB.UI.ProductSitePath.FillCatalogsXML C# (CSharp) Метод

FillCatalogsXML() приватный Метод

private FillCatalogsXML ( Catalog catalog, XmlDocument xmlDoc, XmlElement rootElement ) : void
catalog AJH.CMS.Core.Entities.Catalog
xmlDoc System.Xml.XmlDocument
rootElement System.Xml.XmlElement
Результат void
        private void FillCatalogsXML(Catalog catalog, XmlDocument xmlDoc, XmlElement rootElement)
        {
            if (catalog != null)
            {
                if (catalog.ParentCalalogID > 0)
                {
                    Catalog parentCatalog = CatalogManager.GetCatalog(catalog.ParentCalalogID, CMSContext.LanguageID);
                    if (parentCatalog != null)
                        FillCatalogsXML(parentCatalog, xmlDoc, rootElement);
                }

                XmlElement catalogElement = xmlDoc.CreateElement("Element");
                rootElement.AppendChild(catalogElement);

                XmlAttribute attr = xmlDoc.CreateAttribute("ID");
                attr.Value = catalog.ID.ToString();
                catalogElement.Attributes.Append(attr);

                attr = xmlDoc.CreateAttribute("Name");
                attr.Value = catalog.Name;
                catalogElement.Attributes.Append(attr);

                attr = xmlDoc.CreateAttribute("Type");
                attr.Value = "Catalog";
                catalogElement.Attributes.Append(attr);
            }
        }