Esempio n. 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);
        }
Esempio n. 2
0
 public AlertCompiledView(AlertInfo alert)
 {
     _alert = alert;
 }