📄 frmancestor.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Timers;
using System.Threading;
namespace DS.EMIS.StartPrepare
{
/// <summary>
/// FrmAncestor 的摘要说明。
/// </summary>
public class FrmAncestor : System.Windows.Forms.Form
{
#region ###控件变量###
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
//
// FrmAncestor
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(408, 206);
this.ControlBox = false;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmAncestor";
this.Text = "FrmAncestor";
this.Closing += new System.ComponentModel.CancelEventHandler(this.FrmAncestor_Closing);
}
#endregion
#endregion
#region ### CTOR & Dispose ###
#region CTOR
public FrmAncestor()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//this.timer = new System.Threading.Timer(new TimerCallback(RunPrograss),null,System.Threading.Timeout.Infinite,-1);
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
#endregion
#region Dispose
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#endregion
#endregion
#region ### 自定义变量 ###
//public Thread proThd = new Thread( new ThreadStart(RunPrograss) );
public System.Threading.Timer timer = null;
#endregion
#region ### 自定义属性 ###
private TaskStepState taskState;
public TaskStepState TaskStat
{
get{return this.taskState;}
set{this.taskState = value;}
}
#endregion
#region ### 自定义方法 ###
protected virtual object OnReceive(string sourceName,string infoTypeName,object infoTypeObj)
{
return null;
}
protected virtual void Initialise()
{}
protected virtual void FrmClose()
{}
protected void ShowProgress(string task ,bool flag)
{
DS.EMIS.StartPrepare.Common.GlobalObject.Instance.LocalSession.AsySendMessage
("","FrmStartMain",task,flag);
// if(flag)
// {
// //this.timer.Change(0,100);
// }
// else
// {
// //proThd.Abort();
// this.timer.Change(-1,-1);
// DS.EMIS.StartPrepare.Common.GlobalObject.Instance.LocalSession.AsySendMessage
// ("","FrmStartMain","",-1);
// }
}
public void RunPrograss(object obj)
{
int i=0;
while(i<=100)
{
DS.EMIS.StartPrepare.Common.GlobalObject.Instance.LocalSession.AsySendMessage
("","FrmStartMain","",i);
i++;
if(i>=99)
i=0;
}
}
#endregion
#region ### 自定义事件 ###
#endregion
#region ### 控件事件方法 ###
private void FrmAncestor_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
//try{this.proThd.Resume();this.proThd.Abort();this.proThd = null;}
//catch{}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -