/// <summary> /// Resumes changed events by calling <see cref="ISuspendToken.Resume()"/> for the provided suspend token, and setting the reference to the suspend token to null. /// All event data accumulated during the suspended state are discarded, and thus no change event is triggered even if the instance has changed during the suspended state. /// </summary> /// <param name="suspendToken">The suspend token.</param> public void ResumeSilently(ref ISuspendToken suspendToken) { if (null != suspendToken) { suspendToken.ResumeSilently(); suspendToken = null; } }
/// <summary> /// Decrease the suspend level by disposing the suppress token. The token will fire the Resume event /// if the suppress level falls to zero. You can suppress the resume event by setting argument 'suppressResumeEvent' to true. /// </summary> /// <param name="token"></param> /// <param name="firingOfResumeEvent">Designates whether or not to fire the resume event.</param> /// <returns>The event count accumulated during the suspend phase.</returns> public int Resume(ref ISuspendToken token, EventFiring firingOfResumeEvent) { int result = 0; if (token != null) { if (firingOfResumeEvent == EventFiring.Suppressed) { token.ResumeSilently(); } token.Dispose(); // the OnResume function is called from the SuppressToken token = null; } return(result); }
/// <summary> /// Decrease the suspend level by disposing the suppress token. The token will fire the Resume event /// if the suppress level falls to zero. You can suppress the resume event by setting argument 'suppressResumeEvent' to true. /// </summary> /// <param name="token"></param> /// <param name="firingOfResumeEvent">Designates whether or not to fire the resume event.</param> /// <returns>The event count accumulated during the suspend phase.</returns> public int Resume(ref ISuspendToken token, EventFiring firingOfResumeEvent) { int result = 0; if (token != null) { if (firingOfResumeEvent == EventFiring.Suppressed) { token.ResumeSilently(); } token.Dispose(); // the OnResume function is called from the SuppressToken token = null; } return result; }