public void Cancel()
 {
     if (InDebugMode)
     {
         debugger.AbortRewriteSequence();
     }
     throw new OperationCanceledException();                 // abort rewrite sequence
 }