您的位置:首页 > 编程语言 > C#

c# event事件传递参数

2013-05-13 15:32 218 查看
public class SeatChoosenEventArgs : EventArgs
{
public 呼叫中心工号核对表Entity SeatChoosen;
}

public partial class UCSeatIcon : UserControl
{
private 呼叫中心工号核对表Entity _entity;
public event EventHandler<SeatChoosenEventArgs> SeatChoosenEvent;
private void pictureBox1_Click(object sender, EventArgs e)
{
if (SeatChoosenEvent != null)
{
SeatChoosenEvent(this, new SeatChoosenEventArgs() { SeatChoosen = _entity });
}
}

}


public partial class UCSeatDetailNew : UserControl
{
UCSeatIcon1.SeatChoosenEvent += UCSeatChoose_SeatChoosenEvent;

public void UCSeatChoose_SeatChoosenEvent(object sender, SeatChoosenEventArgs e)
{
//if (SeatChoosenEvent != null)
//{
//    SeatChoosenEvent(sender, e);
//}
呼叫中心工号核对表Entity t =  e.SeatChoosen;
UCSeatIcon seatIcon = (UCSeatIcon)sender;
ActivePeople(seatIcon);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐