AlertList.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections.Generic;
  2. namespace Abp.Web.Mvc.Alerts
  3. {
  4. public class AlertList : List<AlertMessage>
  5. {
  6. public void Add(AlertType type, string text, string title = null, bool dismissible = true)
  7. {
  8. Add(new AlertMessage(type, text, title, dismissible));
  9. }
  10. public void Info(string text, string title = null, bool dismissible = true)
  11. {
  12. Add(new AlertMessage(AlertType.Info, text, title, dismissible));
  13. }
  14. public void Warning(string text, string title = null, bool dismissible = true)
  15. {
  16. Add(new AlertMessage(AlertType.Warning, text, title, dismissible));
  17. }
  18. public void Danger(string text, string title = null, bool dismissible = true)
  19. {
  20. Add(new AlertMessage(AlertType.Danger, text, title, dismissible));
  21. }
  22. public void Success(string text, string title = null, bool dismissible = true)
  23. {
  24. Add(new AlertMessage(AlertType.Success, text, title, dismissible));
  25. }
  26. }
  27. }