1
當從託管客戶端對象模型執行列表項更新時,是否有辦法禁用事件觸發?客戶端對象模型 - 禁用事件觸發
在服務器模型中,我執行以下操作。但是,我找不到在託管客戶端ObjectModel上執行相同操作的方法:
class DisabledEventsScope : SPItemEventReceiver, IDisposable
{ // Boolean to hold the original value of the EventFiringEnabled property
bool _originalValue;
public DisabledEventsScope()
{
// Save off the original value of EventFiringEnabled
_originalValue = base.EventFiringEnabled;
// Set EventFiringEnabled to false to disable it
base.EventFiringEnabled = false;
}
public void Dispose()
{
// Set EventFiringEnabled back to its original value
base.EventFiringEnabled = _originalValue;
}
}
using (DisabledEventsScope scope = new DisabledEventsScope())
{
// State-changing operation occurs here.
spItem.Update();
}
在此先感謝。
感謝您的回答 –