namespace PhsControlDelegate
{
public partial class Student: Person
{
PhsControl.phsControl phsObj = new PhsControl.phsControl();
public delegate void OperationDelegate(string strMessage);
public Student()
{
phsObj.OnJieShouDuanXin +=new PhsControl.JieShouDXHandler(phsObj_OnJieShouDuanXin);
}
public void SetText(string strMessage)
{
txtReceive.AppendText(strMessage);
}
protected void phsObj_OnJieShouDuanXin(Object sender, PhsControl.jsSmsArgs e)
{
OperationDelegate optionDelgate = new OperationDelegate(SetText);
this.BeginInvoke(optionDelgate, new object[] { e.dhHaoMa + " " + e.dxNeiRong + "\t\n" });
}
}
} |