Class converts NotificationTypes to String and the other way.
Пример #1
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            var type = (NotificationType)value;

            writer.WriteValue(NotificationTypeEnumStringConverter.GetString(type));
        }
Пример #2
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var value = (string)reader.Value;

            return(NotificationTypeEnumStringConverter.GetNotificationType(value));
        }