AlertMessage.cs 750 B

123456789101112131415161718192021222324252627282930
  1. using JetBrains.Annotations;
  2. namespace Abp.Web.Mvc.Alerts
  3. {
  4. public class AlertMessage
  5. {
  6. [NotNull]
  7. public string Text
  8. {
  9. get => _text;
  10. set => _text = Check.NotNullOrWhiteSpace(value, nameof(value));
  11. }
  12. private string _text;
  13. public AlertType Type { get; set; }
  14. [CanBeNull]
  15. public string Title { get; set; }
  16. public bool Dismissible { get; set; }
  17. public AlertMessage(AlertType type, [NotNull] string text, string title = null, bool dismissible = true)
  18. {
  19. Type = type;
  20. Text = Check.NotNullOrWhiteSpace(text, nameof(text));
  21. Title = title;
  22. Dismissible = dismissible;
  23. }
  24. }
  25. }