public class HandleEventFiring : SPItemEventReceiver
{
public HandleEventFiring()
{
}
public void CustomDisableEventFiring()
{
this.DisableEventFiring();
}
public void CustomEnableEventFiring()
{
this.EnableEventFiring();
}
}
Use like this:
SPWeb web = site.RootWeb;
SPList list = site.RootWeb.Lists["Testing"];
SPListItem item = list.GetItemById(2);
//update item properties
HandleEventFiring eventFiring = new HandleEventFiring();
eventFiring.CustomDisableEventFiring();
item.SystemUpdate();
eventFiring.CustomEnableEventFiring();
No comments:
Post a Comment