public override IPickerSettings GetSettings(IPublishedPropertyType propertyType)
        {
            var configuration = propertyType.DataType.ConfigurationAs <MultiNodePickerConfiguration>();

            var settings = new PickerSettings
            {
                MaxItems = configuration.MaxNumber
            };

            if (string.IsNullOrEmpty(configuration.Filter) == false)
            {
                settings.AllowedTypes = configuration.Filter.Split(',');
            }

            return(settings);
        }
Esempio n. 2
0
        public override IPickerSettings GetSettings(IPublishedPropertyType propertyType)
        {
            var configuration = propertyType.DataType.ConfigurationAs <NestedContentConfiguration>();

            var settings = new PickerSettings
            {
                MaxItems    = configuration.MaxItems ?? 0,
                DefaultType = typeof(IPublishedElement)
            };

            if (configuration.ContentTypes != null)
            {
                settings.AllowedTypes = configuration.ContentTypes
                                        .Select(x => x.Alias)
                                        .ToArray();
            }

            return(settings);
        }