private
static
void
EventFiringEnabled(
bool
enabled)
{
Assembly assembly = Assembly.Load(
"Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
);
Type type = assembly.GetType(
"Microsoft.SharePoint.SPEventManager"
);
PropertyInfo pi = type.GetProperty(
"EventFiringDisabled"
, System.Reflection.BindingFlags.Static|System.Reflection.BindingFlags.NonPublic);
pi.SetValue(
null
, !enabled,
null
);
}
No comments:
Post a Comment