void ShowImportResult(FontImportResult result) { if (result.Imported.Count == 1) { InAppNotificationHelper.ShowNotification(this, Localization.Get("NotificationSingleFontAdded", result.Imported[0].Name), 4000); } else if (result.Imported.Count > 1) { InAppNotificationHelper.ShowNotification(this, Localization.Get("NotificationMultipleFontsAdded", result.Imported.Count), 4000); } else if (result.Invalid.Count > 0) { StringBuilder sb = new StringBuilder(); sb.AppendLine(Localization.Get("NotificationImportFailed")); sb.AppendLine(); foreach (var i in result.Invalid.Take(5)) { sb.AppendLine($"{i.Item1.Name}: {i.Item2}"); } if (result.Invalid.Count > 5) { sb.Append("…"); } InAppNotificationHelper.ShowNotification(this, sb.ToString().Trim(), 4000); } }
protected void CreateInAppNotification(EditionEntity edition, NotificationType notificationType, string recipients, string actorUserEmail) { var notifications = InAppNotificationHelper.CreateInAppNotifications(edition, notificationType, recipients, actorUserEmail); if (notifications == null) { return; } NotificationServices.CreateNotifications(notifications, 0); }
void OnNotificationMessage(AppNotificationMessage msg) { InAppNotificationHelper.OnMessage(this, msg); }