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);
            }
        }
Example #2
0
 public ImportMessage(FontImportResult result)
 {
     Result = result;
 }