添加项目文件。
This commit is contained in:
175
Szmedi.AIScriptRunner/ProgressBarCtrl/ProgressBarInfo.cs
Normal file
175
Szmedi.AIScriptRunner/ProgressBarCtrl/ProgressBarInfo.cs
Normal file
@@ -0,0 +1,175 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Szmedi.AIScriptRunner.ProgressBarCtrl
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class ProgressBarInfo : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
protected void OnPropertyChanged(string prop)
|
||||
{
|
||||
if (this.PropertyChanged != null)
|
||||
this.PropertyChanged(this, new PropertyChangedEventArgs(prop));
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public ProgressBarInfo()
|
||||
{
|
||||
Percent = 0;
|
||||
IsOver = false;
|
||||
}
|
||||
|
||||
public double Total { get; set; }
|
||||
private double m_ProgressStep;
|
||||
public double ProgressStep
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ProgressStep;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ProgressStep = value;
|
||||
Percent = m_ProgressStep / Total;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private double m_Percent;
|
||||
/// <summary>
|
||||
/// 完成百分比
|
||||
/// </summary>
|
||||
public double Percent
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Percent;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Percent = value;
|
||||
m_Percent= Double.IsNaN(m_Percent) ? 0 : m_Percent;
|
||||
ProgressValue = m_Percent * 100;
|
||||
Message = "完成百分比:" + (m_Percent * 100).ToString("#.##") + "%";
|
||||
OnPropertyChanged("Percent");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private string m_TipMessage;
|
||||
/// <summary>
|
||||
/// 显示信息
|
||||
/// </summary>
|
||||
public string TipMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_TipMessage;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_TipMessage = value;
|
||||
OnPropertyChanged("TipMessage");
|
||||
}
|
||||
}
|
||||
|
||||
private string m_Message;
|
||||
/// <summary>
|
||||
/// 显示信息
|
||||
/// </summary>
|
||||
public string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Message;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Message = value;
|
||||
OnPropertyChanged("Message");
|
||||
}
|
||||
}
|
||||
|
||||
private string m_Message1;
|
||||
/// <summary>
|
||||
/// 显示信息
|
||||
/// </summary>
|
||||
public string Message1
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Message1;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Message1 = value;
|
||||
OnPropertyChanged("Message1");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string m_Message2;
|
||||
/// <summary>
|
||||
/// 显示信息
|
||||
/// </summary>
|
||||
public string Message2
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Message2;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Message2 = value;
|
||||
OnPropertyChanged("Message2");
|
||||
}
|
||||
}
|
||||
|
||||
private string m_Message3;
|
||||
/// <summary>
|
||||
/// 显示信息
|
||||
/// </summary>
|
||||
public string Message3
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Message3;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Message3 = value;
|
||||
OnPropertyChanged("Message3");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否完成
|
||||
/// </summary>
|
||||
public bool IsOver { get; set; }
|
||||
|
||||
private double m_ProgressValue;
|
||||
public double ProgressValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ProgressValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ProgressValue = value;
|
||||
OnPropertyChanged("ProgressValue");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user