c# event事件傳遞參數


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);
        }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM