示例#1
0
        protected void AddCancelMessage(INotificationModel display,
                                        string header        = "speechBubbles/operationCancelledHeader",
                                        string message       = "speechBubbles/operationCancelledText",
                                        bool localizeHeader  = true,
                                        bool localizeMessage = true)
        {
            //if there's already a default event message, don't add our default one
            var msgs = UmbracoContext.GetCurrentEventMessages();

            if (msgs != null && msgs.GetAll().Any(x => x.IsDefaultEventMessage))
            {
                return;
            }

            display.AddWarningNotification(
                localizeHeader ? Services.TextService.Localize(header) : header,
                localizeMessage ? Services.TextService.Localize(message): message);
        }