Class converts NotificationObject to String and the other way.
コード例 #1
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            var type = (NotificationObject)value;

            writer.WriteValue(NotificationObjectEnumStringConverter.GetString(type));
        }
コード例 #2
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var value = (string)reader.Value;

            return(NotificationObjectEnumStringConverter.GetNotificationObject(value));
        }