コード例 #1
0
        /// <summary>
        /// Gets the singleton instance of the <b>ValidatorManager</b>.
        /// </summary>
        /// <returns>The singleton instance of the <b>ValidatorManager</b>.</returns>
        public static ValidatorManager GetInstance()
        {
            if (instance == null) {
                //  ensure only one thread is able to instantiate an instance at a time.
                lock (syncRoot) {
                    if (instance == null) {
                        instance = new ValidatorManager();
                    }
                }
            }

            return instance;
        }
コード例 #2
0
 /// <summary>
 /// Resets the cached validation rules.
 /// </summary>
 public static void Reset()
 {
     instance = null;
     validatorHash.Clear();
 }