コード例 #1
0
        /// <summary>
        /// Adds the translations.
        /// </summary>
        /// <param name="archivedNode">The archived node.</param>
        /// <param name="node">The node.</param>
        /// <returns>Archived node translation list.</returns>
        private static IList <SitemapNodeTranslation> AddTranslations(ArchivedNode archivedNode, SitemapNode node)
        {
            var translations = new List <SitemapNodeTranslation>();

            if (archivedNode.Translations != null)
            {
                foreach (var translation in archivedNode.Translations)
                {
                    translations.Add(new SitemapNodeTranslation
                    {
                        Node     = node,
                        Language = new Language {
                            Id = translation.LanguageId
                        },
                        Title = translation.Title,
                        Url   = translation.Url,
                        UsePageTitleAsNodeTitle = translation.UsePageTitleAsNodeTitle,
                        Macro = translation.Macro
                    });
                }
            }
            return(translations);
        }
コード例 #2
0
 /// <summary>
 /// Adds the translations.
 /// </summary>
 /// <param name="archivedNode">The archived node.</param>
 /// <param name="node">The node.</param>
 /// <returns>Archived node translation list.</returns>
 private static IList<SitemapNodeTranslation> AddTranslations(ArchivedNode archivedNode, SitemapNode node)
 {
     var translations = new List<SitemapNodeTranslation>();
     if (archivedNode.Translations != null)
     {
         foreach (var translation in archivedNode.Translations)
         {
             translations.Add(new SitemapNodeTranslation
             {
                 Node = node,
                 Language = new Language() { Id = translation.LanguageId },
                 Title = translation.Title,
                 Url = translation.Url,
                 UsePageTitleAsNodeTitle = translation.UsePageTitleAsNodeTitle,
                 Macro = translation.Macro
             });
         }
     }
     return translations;
 }