| | |
| | | using System.ComponentModel; |
| | | using System.Threading; |
| | | using DevExpress.XtraEditors; |
| | | using static DevExpress.XtraPrinting.Native.ExportOptionsPropertiesNames; |
| | | |
| | | namespace Gs.DevApp.UserControl |
| | | { |
| | | public partial class ShowDialogForm : DevExpress.XtraEditors.XtraForm |
| | | public partial class ShowDialogForm : XtraForm |
| | | { |
| | | |
| | | |
| | | #region Events |
| | | |
| | | protected override void OnClosing(CancelEventArgs e) |
| | | { |
| | | base.OnClosing(e); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Fields & Properties |
| | | /// <summary> |
| | | /// 标题 |
| | | /// </summary> |
| | | private string caption; |
| | | |
| | | public string Caption |
| | | { |
| | | get { return caption; } |
| | | set { caption = value; } |
| | | } |
| | | /// <summary> |
| | | /// 消息 |
| | | /// 标题 |
| | | /// </summary> |
| | | private string message; |
| | | public string Caption { get; set; } |
| | | |
| | | public string Message |
| | | { |
| | | get { return message; } |
| | | set { message = value; } |
| | | } |
| | | /// <summary> |
| | | /// 描述 |
| | | /// 消息 |
| | | /// </summary> |
| | | private string content; |
| | | public string Message { get; set; } |
| | | |
| | | public string Content |
| | | { |
| | | get { return content; } |
| | | set { content = value; } |
| | | } |
| | | /// <summary> |
| | | /// 进度条最小值 |
| | | /// 描述 |
| | | /// </summary> |
| | | private int minProcess = 1; |
| | | public string Content { get; set; } |
| | | |
| | | public int MinProcess |
| | | { |
| | | get { return minProcess; } |
| | | set { minProcess = value; } |
| | | } |
| | | /// <summary> |
| | | /// 进度条最大值 |
| | | /// 进度条最小值 |
| | | /// </summary> |
| | | private int maxProcess = 100; |
| | | public int MinProcess { get; set; } = 1; |
| | | |
| | | public int MaxProcess |
| | | { |
| | | get { return maxProcess; } |
| | | set { maxProcess = value; } |
| | | } |
| | | /// <summary> |
| | | /// 进度条最大值 |
| | | /// </summary> |
| | | public int MaxProcess { get; set; } = 100; |
| | | |
| | | #endregion |
| | | |
| | | #region Constructed Function |
| | | |
| | | public ShowDialogForm() |
| | | { |
| | | InitializeComponent(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置 |
| | | /// 设置 |
| | | /// </summary> |
| | | /// <param name="_caption">提示</param> |
| | | public ShowDialogForm(string _caption) |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置 |
| | | /// 设置 |
| | | /// </summary> |
| | | /// <param name="_caption"></param> |
| | | /// <param name="_message"></param> |
| | | public ShowDialogForm(string _caption,string _message) |
| | | : this(_caption, _message, "",100) |
| | | public ShowDialogForm(string _caption, string _message) |
| | | : this(_caption, _message, "", 100) |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置 |
| | | /// 设置 |
| | | /// </summary> |
| | | /// <param name="_caption"></param> |
| | | /// <param name="_message"></param> |
| | | /// <param name="_content"></param> |
| | | public ShowDialogForm(string _caption, string _message,string _content) |
| | | public ShowDialogForm(string _caption, string _message, string _content) |
| | | : this(_caption, _message, _content, 100) |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设置 |
| | | /// 设置 |
| | | /// </summary> |
| | | /// <param name="_caption">提示</param> |
| | | /// <param name="_message">消息内容</param> |
| | | /// <param name="_content">详细描述</param> |
| | | /// <param name="_maxProcess">进度条最大值</param> |
| | | public ShowDialogForm(string _caption, string _message,string _content,int _maxProcess) |
| | | public ShowDialogForm(string _caption, string _message, string _content, |
| | | int _maxProcess) |
| | | : this() |
| | | { |
| | | this.Caption = ""; |
| | | this.Message = ""; |
| | | this.Content = ""; |
| | | Caption = ""; |
| | | Message = ""; |
| | | Content = ""; |
| | | |
| | | this.Caption = _caption == "" ? "提示" : _caption; |
| | | this.Message = _message == "" ? "正在加载,请稍后......" : _message; |
| | | this.Content = _content; |
| | | this.maxProcess = _maxProcess > this.MinProcess ? _maxProcess : MinProcess; |
| | | |
| | | lblCaption.Text = this.Caption; |
| | | // lblMessage.Text = this.Message; |
| | | lblContent.Text = this.Content; |
| | | Caption = _caption == "" ? "提示" : _caption; |
| | | Message = _message == "" ? "正在加载,请稍后......" : _message; |
| | | Content = _content; |
| | | MaxProcess = _maxProcess > MinProcess ? _maxProcess : MinProcess; |
| | | |
| | | lblCaption.Text = Caption; |
| | | // lblMessage.Text = this.Message; |
| | | lblContent.Text = Content; |
| | | progressShow.Properties.Minimum = MinProcess; |
| | | progressShow.Properties.Maximum = MaxProcess; |
| | | progressShow.Properties.Step = 1; |
| | | progressShow.PerformStep(); |
| | | |
| | | this.ShowInTaskbar = false; |
| | | this.TopMost = true; |
| | | this.Show(); |
| | | this.Refresh(); |
| | | ShowInTaskbar = false; |
| | | TopMost = true; |
| | | Show(); |
| | | Refresh(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Methods |
| | | |
| | | /// <summary> |
| | | /// 设置提示 |
| | | /// 设置提示 |
| | | /// </summary> |
| | | /// <param name="newCaption"></param> |
| | | public void SetCaption(string newCaption) |
| | | { |
| | | this.Caption = newCaption; |
| | | lblCaption.Text = this.Caption; |
| | | Caption = newCaption; |
| | | lblCaption.Text = Caption; |
| | | progressShow.PerformStep(); |
| | | this.Refresh(); |
| | | Refresh(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置消息 |
| | | /// 设置消息 |
| | | /// </summary> |
| | | /// <param name="newMessage"></param> |
| | | public void SetMessage(string newMessage) |
| | | { |
| | | this.Message = newMessage; |
| | | // lblMessage.Text = this.Message; |
| | | Message = newMessage; |
| | | // lblMessage.Text = this.Message; |
| | | progressShow.PerformStep(); |
| | | this.Refresh(); |
| | | Refresh(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置描述 |
| | | /// 设置描述 |
| | | /// </summary> |
| | | /// <param name="newContent"></param> |
| | | public void SetContent(string newContent) |
| | | { |
| | | this.Content = newContent; |
| | | lblContent.Text = this.Content; |
| | | Content = newContent; |
| | | lblContent.Text = Content; |
| | | progressShow.PerformStep(); |
| | | this.Refresh(); |
| | | Refresh(); |
| | | } |
| | | #endregion |
| | | |
| | | #region Events |
| | | protected override void OnClosing(CancelEventArgs e) |
| | | { |
| | | base.OnClosing(e); |
| | | } |
| | | #endregion |
| | | } |
| | | } |