1.声明事件
public event EventHandler<SelectedBvEventArgs> SelectedBv;
2.定义事件参数
public class SelectedBvEventArgs : EventArgs
{
public SelectedBvEventArgs(string strSelectName,string strEcuName,string strProtocol)
{
this.strBvName = strSelectName;
this.strEcuName = strEcuName;
this.strProtocol = strProtocol;
}
public string strBvName { get; private set; }
public string strEcuName { get; private set; }
public string strProtocol { get; private set; }
}
3.触发事件
SelectedBv(this, new SelectedBvEventArgs(strSelectName,strEcuName,strProtocl));