避免Update事件触发两次
public override void ItemUpdated(SPItemEventProperties properties) { //base.ItemUpdated(properties); base.EventFiringEnabled = false; item.Update(); base.EventFiringEnabled = true; } //In Document library event handlers during Item Updating also checking that Document is it in Check In mode or Check Out. That's why it is called twice. public override void ItemUpdating(SPItemEventProperties properties) { base.ItemUpdating(properties); if (properties.AfterProperties["vti_sourcecontrolcheckedoutby"] == null && properties.BeforeProperties["vti_sourcecontrolcheckedoutby"] != null) { //do stuff } }