/// <summary>
        ///     Gets the wrapped data type key from the current data type's prevalues.
        /// </summary>
        /// <param name="wrapperDataType"></param>
        /// <returns></returns>
        private Guid GetWrappedDataTypeKey(PublishedDataType wrapperDataType)
        {
            Guid dataTypeKey = default;

            var configuration = wrapperDataType.ConfigurationAs <TextCountConfiguration>();

            if (configuration == null)
            {
                return(dataTypeKey);
            }

            if (configuration.DataTypeKey.HasValue && configuration.DataTypeKey.Value != default)
            {
                dataTypeKey = configuration.DataTypeKey.Value;
            }
            else if (configuration.DataTypeId.HasValue && configuration.DataTypeId.Value != default)
            {
                var dataType = _dataTypeService.GetDataType(configuration.DataTypeId.Value);

                if (dataTypeKey != null)
                {
                    dataTypeKey = dataType.Key;
                }
            }

            return(dataTypeKey);
        }
        /// <summary>
        /// Is the media picker configured to pick multiple media items
        /// </summary>
        /// <param name="dataType"></param>
        /// <returns></returns>
        private bool IsMultipleDataType(PublishedDataType dataType)
        {
            var config = dataType.ConfigurationAs <MediaPicker3Configuration>();

            return(config.Multiple);
        }
Example #3
0
 private bool IsMultipleDataType(PublishedDataType dataType) => dataType.ConfigurationAs <MediaPicker3Configuration>().Multiple;
Example #4
0
 /// <summary>
 /// Returns whether the specified <paramref name="dataType"/> represents a multi picker.
 /// </summary>
 /// <param name="dataType">The data type.</param>
 /// <returns><c>true</c> if <paramref name="dataType"/> is a multi picker; otherwise <c>false</c>.</returns>
 private static bool IsMultiPicker(PublishedDataType dataType)
 {
     return(dataType.ConfigurationAs <ImagePickerConfiguration>()?.IsMultiPicker ?? false);
 }