¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.ComponentModel; |
| | | |
| | | namespace Gs.DevApp.UserControl |
| | | { |
| | | public partial class ShowDialogForm : DevExpress.XtraEditors.XtraForm |
| | | { |
| | | #region Fields & Properties |
| | | /// <summary> |
| | | /// æ é¢ |
| | | /// </summary> |
| | | private string caption; |
| | | |
| | | public string Caption |
| | | { |
| | | get { return caption; } |
| | | set { caption = value; } |
| | | } |
| | | /// <summary> |
| | | /// æ¶æ¯ |
| | | /// </summary> |
| | | private string message; |
| | | |
| | | public string Message |
| | | { |
| | | get { return message; } |
| | | set { message = value; } |
| | | } |
| | | /// <summary> |
| | | /// æè¿° |
| | | /// </summary> |
| | | private string content; |
| | | |
| | | public string Content |
| | | { |
| | | get { return content; } |
| | | set { content = value; } |
| | | } |
| | | /// <summary> |
| | | /// è¿åº¦æ¡æå°å¼ |
| | | /// </summary> |
| | | private int minProcess = 1; |
| | | |
| | | public int MinProcess |
| | | { |
| | | get { return minProcess; } |
| | | set { minProcess = value; } |
| | | } |
| | | /// <summary> |
| | | /// è¿åº¦æ¡æå¤§å¼ |
| | | /// </summary> |
| | | private int maxProcess = 100; |
| | | |
| | | public int MaxProcess |
| | | { |
| | | get { return maxProcess; } |
| | | set { maxProcess = value; } |
| | | } |
| | | #endregion |
| | | |
| | | #region Constructed Function |
| | | public ShowDialogForm() |
| | | { |
| | | InitializeComponent(); |
| | | } |
| | | /// <summary> |
| | | /// 设置 |
| | | /// </summary> |
| | | /// <param name="_caption">æç¤º</param> |
| | | public ShowDialogForm(string _caption) |
| | | : this(_caption, "", "", 100) |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置 |
| | | /// </summary> |
| | | /// <param name="_caption"></param> |
| | | /// <param name="_message"></param> |
| | | 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) |
| | | : 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) |
| | | : this() |
| | | { |
| | | this.Caption = ""; |
| | | this.Message = ""; |
| | | this.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; |
| | | progressShow.Properties.Minimum = MinProcess; |
| | | progressShow.Properties.Maximum = MaxProcess; |
| | | progressShow.Properties.Step = 1; |
| | | progressShow.PerformStep(); |
| | | |
| | | this.ShowInTaskbar = false; |
| | | this.TopMost = true; |
| | | this.Show(); |
| | | this.Refresh(); |
| | | } |
| | | #endregion |
| | | |
| | | #region Methods |
| | | /// <summary> |
| | | /// 设置æç¤º |
| | | /// </summary> |
| | | /// <param name="newCaption"></param> |
| | | public void SetCaption(string newCaption) |
| | | { |
| | | this.Caption = newCaption; |
| | | lblCaption.Text = this.Caption; |
| | | progressShow.PerformStep(); |
| | | this.Refresh(); |
| | | } |
| | | /// <summary> |
| | | /// è®¾ç½®æ¶æ¯ |
| | | /// </summary> |
| | | /// <param name="newMessage"></param> |
| | | public void SetMessage(string newMessage) |
| | | { |
| | | this.Message = newMessage; |
| | | // lblMessage.Text = this.Message; |
| | | progressShow.PerformStep(); |
| | | this.Refresh(); |
| | | } |
| | | /// <summary> |
| | | /// 设置æè¿° |
| | | /// </summary> |
| | | /// <param name="newContent"></param> |
| | | public void SetContent(string newContent) |
| | | { |
| | | this.Content = newContent; |
| | | lblContent.Text = this.Content; |
| | | progressShow.PerformStep(); |
| | | this.Refresh(); |
| | | } |
| | | #endregion |
| | | |
| | | #region Events |
| | | protected override void OnClosing(CancelEventArgs e) |
| | | { |
| | | base.OnClosing(e); |
| | | } |
| | | #endregion |
| | | } |
| | | } |