protected virtual void OnModifyPicPath(ModifyPicPathEventArgs e) { if (ModifyPicPathEvent != null) //如果有对象注册 { ModifyPicPathEvent(this, e); //调用所有注册对象的方法 } }
/// <summary> /// 修改图片路径 /// </summary> /// <param name="pictureType"></param> /// <param name="picturePathStr"></param> public void ModifyPicPath() { //代码...// //建立ModifyPicPathEventArgs对象 ModifyPicPathEventArgs e = new ModifyPicPathEventArgs(); OnModifyPicPath(e); //调用OnModifyPicPath方法 }