Пример #1
0
        private string GetRecursiveValue(ICmsContent content, string propertyname, IPropertyParser parser)
        {
            this.log.AddLogentry(SolisSearch.Log.Enum.LogLevel.Debug, string.Format("Property {0} is set as recursive, searching ancestors for node {1}", (object)propertyname, (object)content.Name), (Exception)null);
            string str = string.Empty;

            if (content.ParentId < 0)
            {
                return(str);
            }
            for (ICmsContent cmsContent = this.cmsIndexer.GetContentById(content.ParentId); cmsContent != null && cmsContent.Id != this.cmsIndexer.CmsRootId; cmsContent = this.cmsIndexer.GetParent(cmsContent))
            {
                ICmsProperty property = this.cmsIndexer.GetProperty(cmsContent, propertyname);
                if (property != null && !string.IsNullOrEmpty(property.Value as string))
                {
                    str = parser.GetPropertyValue(property.Value);
                    this.log.AddLogentry(SolisSearch.Log.Enum.LogLevel.Debug, string.Format("Found recursive value {0} for property {1} on node {2}", (object)str, (object)propertyname, (object)cmsContent.Name), (Exception)null);
                    break;
                }
            }
            return(str);
        }