private GotoState ( ProcessingState newProcessingState ) : void | ||
newProcessingState | ProcessingState | |
return | void |
void GotoState(ProcessingState newProcessingState)
{
while (this.processingState != newProcessingState)
{
/* We change the current state one level at a time, to get to
* the desired state.
*/
if (this.processingState < newProcessingState)
{
switch (this.processingState)
{
case ProcessingState.Dormant:
throw new Exception("MISSING_BEGIN_POLYGON");
case ProcessingState.InPolygon:
throw new Exception("MISSING_BEGIN_CONTOUR");
default:
break;
}
}
else
{
switch (this.processingState)
{
case ProcessingState.InContour:
throw new Exception("MISSING_END_CONTOUR");
case ProcessingState.InPolygon:
throw new Exception("MISSING_END_POLYGON");
default:
break;
}
}
}
}