Beispiel #1
0
 /// <summary>
 /// 显示信息窗口(对话框)
 /// </summary>
 /// <param name="text">信息文本(主要的信息内容)</param>
 /// <param name="caption">提示框标题</param>
 /// <param name="buttons">可选按钮</param>
 /// <param name="icon">窗口图标</param>
 /// <param name="defaultButton">默认选择的按钮(从左到右第几个)</param>
 /// <param name="options">选项</param>
 /// <returns>对话框结果</returns>
 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
 {
     return(SWF.MessageBox.Show(text, caption, buttons, icon, defaultButton, options));
 }
Beispiel #2
0
 public static WF.DialogResult ShowMessage(WF.IWin32Window owner = null, string text = null, string caption = null, WF.MessageBoxButtons buttons = WF.MessageBoxButtons.OK, WF.MessageBoxIcon icon = WF.MessageBoxIcon.Information, WF.MessageBoxDefaultButton defaultButton = WF.MessageBoxDefaultButton.Button1)
 {
     if (owner == null)
     {
         owner = GetMainForm();
     }
     if (string.IsNullOrEmpty(text))
     {
         text = "Informace nebyla zadána";
     }
     if (string.IsNullOrEmpty(caption))
     {
         caption = AppTitle;
     }
     if (owner != null && owner is WF.Form form && form.InvokeRequired)
     {
         return((WF.DialogResult)form.Invoke(new Func <WF.IWin32Window, string, string, WF.MessageBoxButtons, WF.MessageBoxIcon, WF.MessageBoxDefaultButton, WF.DialogResult>(_ShowMessage), owner, text, caption, buttons, icon, defaultButton));
     }
Beispiel #3
0
        /// <summary>
        /// 显示信息窗口(对话框) 在对顶层
        /// </summary>
        /// <param name="text">信息文本(主要的信息内容)</param>
        /// <param name="caption">提示框标题</param>
        /// <param name="buttons">可选按钮</param>
        /// <param name="icon">窗口图标</param>
        /// <param name="defaultButton">默认选择的按钮(从左到右第几个)</param>
        /// <param name="options">选项</param>
        /// <param name="helpFilePath">帮助文件路劲</param>
        /// <param name="navigator">导航方式</param>
        /// <param name="param">用户单击帮助按钮时要显示的帮助主题的数字ID</param>
        /// <returns>对话框结果</returns>
        public static DialogResult ShowOnTopMost(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param)
        {
            var topf   = GetShowedTopMostForm();
            var result = SWF.MessageBox.Show(topf, text, caption, buttons, icon, defaultButton, options, helpFilePath, navigator, param);

            topf.Hide();
            return(result);
        }
Beispiel #4
0
        /// <summary>
        /// 显示信息窗口(对话框) 在对顶层
        /// </summary>
        /// <param name="text">信息文本(主要的信息内容)</param>
        /// <param name="caption">提示框标题</param>
        /// <param name="buttons">可选按钮</param>
        /// <param name="icon">窗口图标</param>
        /// <param name="defaultButton">默认选择的按钮(从左到右第几个)</param>
        /// <param name="options">选项</param>
        /// <returns>对话框结果</returns>
        public static DialogResult ShowOnTopMost(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
        {
            var topf   = GetShowedTopMostForm();
            var result = SWF.MessageBox.Show(topf, text, caption, buttons, icon, defaultButton, options);

            topf.Hide();
            return(result);
        }
Beispiel #5
0
 /// <summary>
 /// 显示信息窗口(对话框)
 /// </summary>
 /// <param name="text">信息文本(主要的信息内容)</param>
 /// <param name="caption">提示框标题</param>
 /// <param name="buttons">可选按钮</param>
 /// <param name="icon">窗口图标</param>
 /// <param name="defaultButton">默认选择的按钮(从左到右第几个)</param>
 /// <param name="options">选项</param>
 /// <param name="helpFilePath">帮助文件路劲</param>
 /// <param name="navigator">导航方式</param>
 /// <param name="param">用户单击帮助按钮时要显示的帮助主题的数字ID</param>
 /// <returns>对话框结果</returns>
 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param)
 {
     return(SWF.MessageBox.Show(text, caption, buttons, icon, defaultButton, options, helpFilePath, navigator, param));
 }
Beispiel #6
0
 /// <summary>
 /// 显示信息窗口(对话框)
 /// </summary>
 /// <param name="text">信息文本(主要的信息内容)</param>
 /// <param name="caption">提示框标题</param>
 /// <param name="buttons">可选按钮</param>
 /// <param name="icon">窗口图标</param>
 /// <param name="defaultButton">默认选择的按钮(从左到右第几个)</param>
 /// <param name="options">选项</param>
 /// <param name="helpFilePath">帮助文件路劲</param>
 /// <param name="keyword">关键字</param>
 /// <returns>对话框结果</returns>
 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, string helpFilePath, string keyword)
 {
     return(SWF.MessageBox.Show(text, caption, buttons, icon, defaultButton, options, helpFilePath, keyword));
 }
        /*
         * internal override ResourceEditorRootDesigner RootDesigner
         * {
         *  get
         *  {
         *      return Fake_rootDesigner;
         *  }
         * }
         */

        public override DialogResult DsMsgBox(string Message, System.Windows.Forms.MessageBoxButtons Buttons, System.Windows.Forms.MessageBoxIcon Icon, System.Windows.Forms.MessageBoxDefaultButton DefaultButton, string HelpLink)
        {
            FakeResult_DSMsgBoxWasCalledWithThisString = Message;
            return(Fake_DsMsgReturnValue);
        }