Exemplo n.º 1
0
        /// <summary>
        /// Returns the single instance of the <c>StateManager</c>.
        /// </summary>
        /// <returns>The single instance of the <c>StateManager</c></returns>
        public static StateManager GetInstance()
        {
            if (instance == null) {
                //  ensure only one thread is able to instantiate an instance at a time.
                lock (syncRoot) {
                    if (instance == null) {
                        instance = new StateManager();
                    }
                }
            }

            return instance;
        }
Exemplo n.º 2
0
 public void Reset()
 {
     instance = null;
     LogManager.GetCurrentClassLogger().Info(
             infoMessage => infoMessage("StateManager reset."));
 }