예제 #1
0
        public override object ReadJson(
            JsonReader reader,
            Type objectType,
            object existingValue,
            JsonSerializer serializer)
        {
            var jo = JObject.Load(reader);

            var notifyEntry = new AlertInfo
            {
                Message = new HtmlString(jo.Value <string>("Message"))
            };

            if (Enum.TryParse(jo.Value <string>("Type"), out AlertType type))
            {
                notifyEntry.Type = type;
            }

            return(notifyEntry);
        }
예제 #2
0
 public AlertCompiledView(AlertInfo alert)
 {
     _alert = alert;
 }