public static bool IsSingleNestedContentProperty(this PublishedPropertyType publishedProperty)
        {
            if (!publishedProperty.IsNestedContentProperty())
            {
                return(false);
            }

            var preValueCollection = NestedContentHelper.GetPreValuesCollectionByDataTypeId(publishedProperty.DataTypeId);
            var preValueDictionary = preValueCollection.PreValuesAsDictionary.ToDictionary(x => x.Key, x => x.Value.Value);

            int minItems, maxItems;

            return(preValueDictionary.ContainsKey("minItems") &&
                   int.TryParse(preValueDictionary["minItems"], out minItems) && minItems == 1 &&
                   preValueDictionary.ContainsKey("maxItems") &&
                   int.TryParse(preValueDictionary["maxItems"], out maxItems) && maxItems == 1);
        }
Esempio n. 2
0
 public override bool IsConverter(PublishedPropertyType propertyType)
 {
     return(propertyType.IsNestedContentProperty() && !propertyType.IsSingleNestedContentProperty());
 }