コード例 #1
0
        public void Show(string message, ViewNotifierType type, string title = null, string icon = null)
        {
            var snackType = Severity.Success;

            switch (type)
            {
                case ViewNotifierType.Error:
                    snackType = Severity.Error;
                    break;
                case ViewNotifierType.Warning:
                    snackType = Severity.Warning;
                    break;
                case ViewNotifierType.Info:
                    snackType = Severity.Info;
                    break;
            }

            if (!string.IsNullOrWhiteSpace(title))
                message = $"<b>{title}</b><br />{message}";

            snackbar.Add(message, snackType, config =>
            {
                if (icon != null)
                    config.Icon = icon;
            });
        }
コード例 #2
0
        public void Show(string message, ViewNotifierType type, string title = null, string icon = null)
        {
            var matType = MatToastType.Success;

            switch (type)
            {
            case ViewNotifierType.Error:
                matType = MatToastType.Danger;
                break;

            case ViewNotifierType.Warning:
                matType = MatToastType.Warning;
                break;

            case ViewNotifierType.Info:
                matType = MatToastType.Info;
                break;
            }

            matToaster.Add(message, matType, title, icon);
        }