Exemple #1
0
 public Toast(string message, ToasterType type, bool isFront = false)
 {
     Message = message;
     Type    = type.ToString();
     if (isFront)
     {
         Position = "bottom-left";
     }
 }
 public ToasterEvent(string entityType, ToasterType toasterType, ToasterVerbs verb, string identifier = null,
                     int count = 1)
 {
     EntityType  = entityType;
     ToasterType = toasterType;
     Verb        = verb;
     Identifier  = identifier;
     Count       = count;
 }
Exemple #3
0
        public void Show(Control content, int timeout = 3000, ToasterType type = ToasterType.Normal)
        {
            _cleared = false;
            _timeout = timeout;
            var closeBtn = new IconButton(Icons.Close, (_) =>
            {
                Clear();
            });

            closeBtn.AddClass("toaster-close");
            var wrapper = new Div(content, closeBtn);

            wrapper.SetClass($"toaster-wrapper toaster-{type.ToString().ToLower()}");
            _lastWrapperId = wrapper.HtmlElement.ID;
            _dc.Content    = wrapper;
        }
Exemple #4
0
 public IViewComponentResult Invoke(string message, ToasterType toasterType = ToasterType.info)
 {
     return(View(new ToasterViewModel {
         Message = message, ToasterType = toasterType
     }));
 }
        public Toaster ShowToaster(object content, string icon = null, int timeout = 3000, ToasterType type = ToasterType.Normal)
        {
            if (icon == null)
            {
                _toaster.Show(Layout.Horizontal(content), timeout, type);
            }
            else
            {
                _toaster.Show(Layout.Middle().Horizontal(new Icon(icon), content, timeout, type));
            }

            return(_toaster);
        }
 public Toaster ShowToaster(Control content, int timeout = 3000, ToasterType type = ToasterType.Normal)
 {
     _toaster.Show(content, timeout, type);
     return(_toaster);
 }
Exemple #7
0
 public Toast(string message, ToasterType type, string position)
 {
     Message  = message;
     Type     = type.ToString();
     Position = position;
 }