📄 threadstatus.cs
字号:
using System;
using System.Threading;
namespace SECompare.Structure
{
/// <summary>
/// This class is the base class of all the thread-based classes which need to report thread status.
/// </summary>
public class ThreadStatus
{
/// <summary>
/// The thread to run.
/// </summary>
private Thread thread;
/// <summary>
/// Thread target.
/// </summary>
protected ThreadStart threadStart;
/// <summary>
/// Set Setting of supported engines.
/// </summary>
public EngineSetting EngineSetting
{
set
{
this.mEngineSetting = value;
}
}
protected EngineSetting mEngineSetting;
/// <summary>
/// Now processing file name.
/// </summary>
protected String mProcessingFile = "";
public String ProcessingFile
{
get
{
return this.mProcessingFile;
}
}
/// <summary>
/// Percentage of file processing, between 0 and 1.
/// </summary>
protected float mFilePercentage = 0;
public float FilePercentage
{
get
{
return this.mFilePercentage;
}
}
/// <summary>
/// Now processing entry in the processing file.
/// </summary>
protected String mProcessingEntry = "";
public String ProcessingEntry
{
get
{
return this.mProcessingEntry;
}
}
/// <summary>
/// Percentage of entry processing in the processing file, between 0 and 1.
/// </summary>
protected float mEntryPercentage = 0;
public float EntryPercentage
{
get
{
return this.mEntryPercentage;
}
}
/// <summary>
/// If the thread has been finished.
/// </summary>
protected bool mIsFinished = false;
public bool IsFinished
{
get
{
return this.mIsFinished;
}
}
/// <summary>
/// String which represents the thread status.
/// </summary>
public String Status
{
get
{
return
"[" + (this.mFilePercentage*100) + "%]"
+ this.mProcessingFile
+ "[" + (this.mEntryPercentage*100) + "%]"
+ this.mProcessingEntry;
}
}
public void Start()
{
this.thread = new Thread(this.threadStart);
this.thread.Start();
}
public void Suspend()
{
this.thread.Suspend();
}
public void Resume()
{
this.thread.Resume();
}
public void Interrupt()
{
this.thread.Interrupt();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -