/// <summary> /// Gets an icon based on Material Design Icons collection, version 3.6.95 /// </summary> /// <param name="alert"></param> /// <returns></returns> public static char GetIcon(this IAlertModel alert) { char icon; switch (alert.Type) { case AlertTypes.Default: icon = '\uf2fd'; break; case AlertTypes.Warning: icon = '\uf02a'; break; case AlertTypes.Critical: icon = '\uf5d6'; break; case AlertTypes.Network: icon = '\uf5aa'; break; case AlertTypes.Sync: icon = '\uf4e8'; break; default: icon = '\ufffd'; break; } return(icon); }
public static void Clear(this IAlertModel alertModel) { if (alertModel == null) { throw new ArgumentNullException(nameof(alertModel)); } alertModel.HasAlert = false; }
public static void Update(this IAlertModel alertModel, IAlert alert) { if (alertModel == null) { throw new ArgumentNullException(nameof(alertModel)); } alertModel.Id = alert.Id; alertModel.Title = alert.Title; alertModel.Content = alert.Content; alertModel.HasAlert = true; }
public static IAlert ToAlert(this IAlertModel alertModel) { return(new Alert(alertModel.Id, alertModel.Title, alertModel.Content)); }