Class ProductJsonConverter
Namespace: Aurigma.DesignAtoms.Serialization
Assembly: Aurigma.DesignAtoms.dll
Syntax
public class ProductJsonConverter : JsonConverter
Inheritance: System.Object -> ProductJsonConverter
Constructors
ProductJsonConverter
public ProductJsonConverter(IConfiguration configuration, IFontService fontService, IStateResourcesRepository stateResourcesRepository, IRepositoryFileProtectorFactory repositoryFileProtectorFactory, IImageLoader imageLoader, IColorManagement colorManagement, ILifetimeScope scope, ISvgReaderFactory svgReaderFactory, ISerializableStorage serializationStorage = null, IStateResourcesRepository runTimeStorage = null, bool convertUrlSourcesToStorage = false, JsonSerializerSettings jsonSerializerSettings = null)
Properties
ColorConverter
protected virtual JsonConverter ColorConverter { get; }
Methods
GetConverters
protected virtual IEnumerable<JsonConverter> GetConverters(IConfiguration configuration, IStateResourcesRepository stateResourcesRepository, ISerializableStorage serializationStorage, IStateResourcesRepository runTimeStorage, IImageLoader imageLoader, IColorManagement colorManagement, IFontService fontService, ILifetimeScope scope, IRepositoryFileProtector repositoryFileProtector, ISvgReaderFactory svgReaderFactory, bool convertUrlSourcesToStorage)
Parameters
| Type | Name | Description |
|---|---|---|
| Aurigma.DesignAtoms.Configuration.IConfiguration | configuration | |
| Aurigma.DesignAtoms.Storage.Repositories.Interfaces.IStateResourcesRepository | stateResourcesRepository | |
Aurigma.DesignAtoms.Cache.Abstractions.Interfaces.ISerializableStorage | serializationStorage | |
| Aurigma.DesignAtoms.Storage.Repositories.Interfaces.IStateResourcesRepository | runTimeStorage | |
| Aurigma.DesignAtoms.Canvas.IImageLoader | imageLoader | |
| Aurigma.DesignAtoms.ColorManagement.IColorManagement | colorManagement | |
| Aurigma.DesignAtoms.Services.IFontService | fontService | |
Autofac.ILifetimeScope | scope | |
| Aurigma.DesignAtoms.Storage.Repositories.Interfaces.Protectors.IRepositoryFileProtector | repositoryFileProtector | |
| Aurigma.DesignAtoms.Common.Interfaces.ISvgReaderFactory | svgReaderFactory | |
System.Boolean | convertUrlSourcesToStorage |
Returns
System.Collections.Generic.IEnumerable<Newtonsoft.Json.JsonConverter>
GetInternalConverters
public IEnumerable<JsonConverter> GetInternalConverters()
Returns
System.Collections.Generic.IEnumerable<Newtonsoft.Json.JsonConverter>
WriteJson
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
Parameters
| Type | Name | Description |
|---|---|---|
Newtonsoft.Json.JsonWriter | writer | |
System.Object | value | |
Newtonsoft.Json.JsonSerializer | serializer |
ReadJson
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer topSerializer)
Parameters
| Type | Name | Description |
|---|---|---|
Newtonsoft.Json.JsonReader | reader | |
System.Type | objectType | |
System.Object | existingValue | |
Newtonsoft.Json.JsonSerializer | topSerializer |
Returns
System.Object
CanConvert
public override bool CanConvert(Type objectType)
Parameters
| Type | Name | Description |
|---|---|---|
System.Type | objectType |
Returns
System.Boolean
Fields
_serializationStorage
protected readonly ISerializableStorage _serializationStorage
_runTimeStorage
protected readonly IStateResourcesRepository _runTimeStorage
_stateResourcesRepository
protected readonly IStateResourcesRepository _stateResourcesRepository
_configuration
protected readonly IConfiguration _configuration
_jsonSerializerSettings
protected readonly JsonSerializerSettings _jsonSerializerSettings
_fontService
protected readonly IFontService _fontService
_imageLoader
protected readonly IImageLoader _imageLoader
_colorManagement
protected readonly IColorManagement _colorManagement
_scope
protected readonly ILifetimeScope _scope
_svgReaderFactory
protected readonly ISvgReaderFactory _svgReaderFactory
_repositoryFileProtectorFactory
protected readonly IRepositoryFileProtectorFactory _repositoryFileProtectorFactory