/// <summary> /// Gets the searchable property values. /// </summary> /// <param name="contentData">The content data.</param> /// <param name="contentType">Type of the content.</param> /// <returns>A list of prperty values.</returns> private IEnumerable <string> GetSearchablePropertyValues( IContentData contentData, ContentType contentType) { if (contentType == null) { yield break; } foreach (PropertyDefinition current in from d in contentType.PropertyDefinitions where d.Searchable || typeof(IPropertyBlock).IsAssignableFrom( c: d.Type.DefinitionType) select d) { PropertyData propertyData = contentData.Property[name : current.Name]; if (propertyData is IPropertyBlock propertyBlock) { foreach (string current2 in this.GetSearchablePropertyValues( contentData: propertyBlock.Block, contentTypeId: propertyBlock.BlockPropertyDefinitionTypeID)) { yield return(current2); } } else { yield return(propertyData.ToWebString()); } } }
/// <summary> /// Gets searchable property values for content /// </summary> /// <param name="contentData"></param> /// <param name="contentType"></param> /// <returns></returns> public static IEnumerable <string> GetSearchablePropertyValues(IContentData contentData, ContentType contentType) { if (contentType == null) { yield break; } foreach (PropertyDefinition current in from d in contentType.PropertyDefinitions where d.Searchable || typeof(IPropertyBlock).IsAssignableFrom(d.Type.DefinitionType) select d) { PropertyData propertyData = contentData.Property[current.Name]; IPropertyBlock propertyBlock = propertyData as IPropertyBlock; if (propertyBlock != null) { foreach (string current2 in GetSearchablePropertyValues(propertyBlock.Block, propertyBlock.BlockPropertyDefinitionTypeID)) { yield return(current2); } } else { yield return(propertyData.ToWebString()); } } yield break; }
private System.Collections.Generic.IEnumerable <string> GetSearchablePropertyValues(IContentData contentData, ContentType contentType) { if (contentType != null) { foreach (PropertyDefinition current in from d in contentType.PropertyDefinitions where d.Searchable || typeof(IPropertyBlock).IsAssignableFrom(d.Type.DefinitionType) select d) { PropertyData propertyData = contentData.Property[current.Name]; var propertyBlock = propertyData as IPropertyBlock; if (propertyBlock != null) { foreach (string current2 in this.GetSearchablePropertyValues(propertyBlock.Block, propertyBlock.BlockType)) { yield return(current2); } } else { yield return(propertyData.ToWebString()); } } } }