private void CancelSequence()
 {
     lock (syncRoot) {
         UnSubscribeFromEvents();
         if (sequenceGenerator != null)
         {
             sequenceGenerator.Close();
             sequenceGenerator = null;
         }
     }
 }