private void CheckStateTransition(ValidatorState toState, string methodName)
{
if (!ValidStates[(int)_currentState, (int)toState])
{
if (_currentState == ValidatorState.None)
{
throw new InvalidOperationException(SR.Format(SR.Sch_InvalidStartTransition, new string[] { methodName, s_methodNames[(int)ValidatorState.Start] }));
}
throw new InvalidOperationException(SR.Format(SR.Sch_InvalidStateTransition, new string[] { s_methodNames[(int)_currentState], methodName }));
}
_currentState = toState;
}