Пример #1
0
        private object ConvertFromEditValue(EditFieldTypeConverterArgs args, JToken item)
        {
            var fieldTypeMetadata = _fieldTypeMetadataService.Get(args.FieldDefinition.FieldType);
            var fieldTypeInstance = fieldTypeMetadata.CreateInstance(args.FieldDefinition);

            return(args.FieldDefinition.Id.Equals(SystemFieldDefinitionConstants.ThumbnailsMetadata, StringComparison.OrdinalIgnoreCase)
                ? item.ToObject(Type.GetType("System.Collections.Generic.List`1[[Litium.Application.Common.ThumbnailMetadata, Litium.Application]], mscorlib"), _jsonSerializer)
                : fieldTypeInstance.ConvertFromJsonValue(item.ToObject(fieldTypeMetadata.JsonType, _jsonSerializer)));
        }
Пример #2
0
 public GoogleMapEditFieldTypeConverter(FieldTypeMetadataService fieldTypeMetadataService)
 {
     _fieldTypeMetadata = fieldTypeMetadataService.Get(FieldTypeConstants.GoogleMap);
 }
Пример #3
0
 public FieldTypeConverterBase(FieldTypeMetadataService fieldTypeMetadataService, string fieldTypeMetadataServiceName)
 {
     _fieldTypeMetadata = fieldTypeMetadataService.Get(fieldTypeMetadataServiceName);
 }