コード例 #1
0
 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()
     }));
 }
コード例 #2
0
        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
            });
        }
コード例 #3
0
 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()
     }));
 }
コード例 #4
0
ファイル: LollipopXListBox.cs プロジェクト: mr-amini/ComU
        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;
        }
コード例 #5
0
ファイル: ScriptBox.cs プロジェクト: s-ho-hosseini/CorMon
 /// <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() + " });");
 }
コード例 #6
0
ファイル: ScriptBox.cs プロジェクト: s-ho-hosseini/CorMon
        /// <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));
        }
コード例 #7
0
ファイル: Noty.cs プロジェクト: hootanht/PersianComponents
 public Noty Layout(MessageAlignment value)
 {
     Attributes["layout"] = string.Format("'{0}'", value.ToString().ToLowerFirst());
     SetScript();
     return(this);
 }
コード例 #8
0
 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));
 }