Пример #1
0
 private void EnterWriteState(MzMLWriteState expectedWs, MzMLWriteState newWs)
 {
     if (consumedWriteStates.Contains(newWs))
     {
         throw new MzLiteIOException("Can't reentering write state: '{0}'.", newWs);
     }
     EnsureWriteState(expectedWs);
     currentWriteState = newWs;
     consumedWriteStates.Add(newWs);
 }
Пример #2
0
 private void EnsureWriteState(MzMLWriteState expectedWs)
 {
     if (currentWriteState == MzMLWriteState.ERROR)
     {
         throw new MzLiteIOException("Current write state is ERROR.");
     }
     if (currentWriteState == MzMLWriteState.CLOSED)
     {
         throw new MzLiteIOException("Current write state is CLOSED.");
     }
     if (currentWriteState != expectedWs)
     {
         throw new MzLiteIOException("Invalid write state: expected '{0}' but current is '{1}'.", expectedWs, currentWriteState);
     }
 }
Пример #3
0
 private void LeaveWriteState(MzMLWriteState expectedWs, MzMLWriteState newWs)
 {
     EnsureWriteState(expectedWs);
     currentWriteState = newWs;
 }