/// <summary> /// Add a new FiniteState to the collection of states managed by this state machine. /// </summary> /// <param name="StateToAdd">The finite state to add.</param> /// <returns>A reference to the finite state that was just added.</returns> /// <exception cref="ArgumentException">Thrown if you try to add a finite state that has already been added.</exception> public FiniteState AddState(FiniteState StateToAdd) { string methodName = System.Reflection.MethodBase.GetCurrentMethod().Name; try { if (log.IsDebugEnabled) { log.Debug($"{methodName}: enter"); } return(engine.AddState(StateToAdd)); } finally { if (log.IsDebugEnabled) { log.Debug($"{methodName}: exit"); } } }