/// <summary> /// 引发 <see cref="ResourceSelectionChanged" /> 事件 /// </summary> /// <param name="ea">包含此事件的参数</param> protected virtual void OnResourceSelectionChanged(ResourceSelectionEventArgs ea) { var handler = ResourceSelectionChanged; if (handler != null) { handler(this, ea); } }
void InitSelection() { lv.SelectedIndexChanged += (s, e) => { var ea = new ResourceSelectionEventArgs(CurrentSelection); OnResourceSelectionChanged(ea); }; }
void lv_SelectedIndexChanged(object sender, EventArgs e) { var ea = new ResourceSelectionEventArgs(CurrentSelection, TorrentResourceProvider); OnResourceSelectionChanged(ea); }