/// <summary> /// Called by the monitor stack to indicate that this monitor should cancel. /// </summary> /// <remarks>This is only for use by the progress monitor stack. Any other use will cause problems.</remarks> internal void Cancel() { lock (m_Lock) { if (m_Complete) { //nothing more to do - complete beat us to it return; } //otherwise, we now need to signal that we're canceled. if (m_ReadOnly) { //we don't want to throw an exception, this is an internal method return; } m_ReadOnly = true; OnMonitorCanceled(); //we are done, pop ourself off the monitor stack. m_ProgressMonitors.PopMonitor(this); } }