public static JsonResult Show(MessageType type, MessageAlignment alignment = MessageAlignment.Center) { return(new JsonResult(new { message = DbRes.T(type.ToString() == "NotValid"?"Error":type.ToString(), "MessageBox"), type = type.ToString().ToLower(), alignment = alignment.ToString().ToLower() })); }
public static JavaScriptResult Show(string message, MessageType type = MessageType.Alert, bool modal = false, MessageAlignment layout = MessageAlignment.Center, bool dismissQueue = false) { string txt = "$.noty.closeAll(); noty({ text: \"" + message + "\", type: \"" + type.ToString().ToLower() + "\", layout: \"" + layout.ToString().ToLowerFirst() + "\", dismissQueue: " + dismissQueue.ToString().ToLower() + ", modal: " + modal.ToString().ToLower() + " });"; return(new JavaScriptResult() { Script = txt }); }
public static JsonResult Custom(string title, string message, MessageType type = MessageType.Success, MessageAlignment alignment = MessageAlignment.Center ) { return(new JsonResult(new { title = title, text = message, type = type.ToString().ToLower(), alignment = alignment.ToString().ToLower() })); }
public void Add(LollipopMessage Message,MessageAlignment Align) { Controls.Add(Message); if (Align == MessageAlignment.Left) { if (Message.Width > (Width / 2)) { Message.Width = (Width / 2); } Message.Left = 2; } else { if (Message.Width > (Width / 2)) { Message.Width = (Width / 2); Message.Left = (Width / 2) - 5; } else { Message.Left = Width - Message.Width; } } int h = (Message.Text.Length / (Message.Width / 7) * 30); if (h == 0) { row += 35; } else if (h == 30) { row += 60; } else if (h >= 31) { row += h + (10 - (h / 10)); } Message.Location = new Point(Message.Left, row); VerticalScroll.Value = VerticalScroll.Maximum; Message.Visible = true; }
/// <summary> /// /// </summary> private static string GetMessageScript(string message, MsgType type, bool modal, MessageAlignment layout, bool dismissQueue) { return("$.noty.closeAll(); noty({ text: \"" + message + "\", type: \"" + type.ToString() + "\", layout: \"" + layout + "\", dismissQueue: " + dismissQueue.ToString().ToLower() + ", modal: " + modal.ToString().ToLower() + " });"); }
/// <summary> /// /// </summary> public static JavaScriptResult ShowMessage(string message, MsgType type = MsgType.alert, bool modal = true, MessageAlignment layout = MessageAlignment.top, bool dismissQueue = false) { string script = GetMessageScript(message, type, modal, layout, dismissQueue); return(new JavaScriptResult(script: script)); }
public Noty Layout(MessageAlignment value) { Attributes["layout"] = string.Format("'{0}'", value.ToString().ToLowerFirst()); SetScript(); return(this); }
public static Noty Noty(string text, MessageType type = MessageType.Alert, bool modal = false, MessageAlignment layout = MessageAlignment.Center, bool dismissQueue = false) { return(new Noty().Text(text).Type(type).Modal(modal).Layout(layout).DismissQueue(dismissQueue)); }