public void AddState(WizardState state)
 {
     if (!m_states.ContainsKey(state.Name))
     {
         state.StateManager = this;
         m_states.Add(state.Name, state);
         state.Visible = false;
         state.Enabled = false;
     }
     else
         throw new InvalidOperationException();
 }
        public void SetCurrentState(String name)
        {
            if (currentState != null && name == currentState.Name)
                return;
            if (!m_states.ContainsKey(name))
                throw new KeyNotFoundException();

            WizardState newState = m_states[name];
            newState.ActivateState();
            if (currentState != null)
                currentState.DeactivateState();
            currentState = newState;
        }