Ejemplo n.º 1
0
        private LanguageInfo[] FindLanguagesRecursive(int rootNodeID)
        {
            List <LanguageInfo> languages = new List <LanguageInfo>();

            foreach (ILanguage language in descendantFinder.Find <ILanguage>(persister.Get(rootNodeID)))
            {
                if (!string.IsNullOrEmpty(language.LanguageCode))
                {
                    var languageItem = language as ContentItem;
                    if (languageItem != null && languageItem.ID > 0)
                    {
                        languages.Add(new LanguageInfo {
                            ID = languageItem.ID, LanguageCode = language.LanguageCode
                        });
                    }
                }
            }
            return(languages.ToArray());
        }
Ejemplo n.º 2
0
        public virtual IEnumerable <Site> GetSites()
        {
            List <Site> foundSites = new List <Site>();

            try
            {
                foreach (ISitesSource source in finder.Find <ISitesSource>(persister.Get(host.DefaultSite.RootItemID)))
                {
                    foreach (Site s in source.GetSites())
                    {
                        foundSites.Add(s);
                    }
                }
            }
            catch (Exception ex)
            {
                Trace.TraceWarning("DynamicSitesProvider.GetSites:" + ex);
            }

            return(foundSites);
        }