Posted By

nickaranz on 08/12/11


Tagged

class events Workflows


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jlaws0n


Disable Event Firing anywhere SharePoint 2010


 / Published in: C#
 

URL: http://adrianhenke.wordpress.com/2010/01/29/disable-item-events-firing-during-item-update/

  1. class DisabledItemEventsScope : SPItemEventReceiver, IDisposable
  2. {
  3. bool oldValue;
  4.  
  5. public DisabledItemEventsScope()
  6. {
  7. this.oldValue = base.EventFiringEnabled;
  8. base.EventFiringEnabled = false;
  9. }
  10.  
  11. #region IDisposable Members
  12.  
  13. public void Dispose()
  14. {
  15. base.EventFiringEnabled = oldValue;
  16. }
  17.  
  18. #endregion
  19. }

Report this snippet  

You need to login to post a comment.