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