Beispiel #1
0
        /// <summary>
        /// Attempts to change the <see cref="ExceptionSwallower"/> instance.
        /// </summary>
        /// <param name="newInstance">The new <see cref="ExceptionSwallower"/> instance.</param>
        /// <returns>True if the <paramref name="newInstance"/> was set as the new global <see cref="ExceptionSwallower"/>
        /// instance; otherwise false.</returns>
        public static bool TrySetInstance(ExceptionSwallower newInstance)
        {
            if (newInstance == null)
            {
                return(false);
            }

            _instance = newInstance;

            return(true);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes the <see cref="ExceptionSwallower"/> class.
 /// </summary>
 static ExceptionSwallower()
 {
     // Set the default ExceptionSwallower instance
     _instance = new ExceptionSwallower();
 }
Beispiel #3
0
        /// <summary>
        /// Attempts to change the <see cref="ExceptionSwallower"/> instance.
        /// </summary>
        /// <param name="newInstance">The new <see cref="ExceptionSwallower"/> instance.</param>
        /// <returns>True if the <paramref name="newInstance"/> was set as the new global <see cref="ExceptionSwallower"/>
        /// instance; otherwise false.</returns>
        public static bool TrySetInstance(ExceptionSwallower newInstance)
        {
            if (newInstance == null)
                return false;

            _instance = newInstance;

            return true;
        }
Beispiel #4
0
 /// <summary>
 /// Initializes the <see cref="ExceptionSwallower"/> class.
 /// </summary>
 static ExceptionSwallower()
 {
     // Set the default ExceptionSwallower instance
     _instance = new ExceptionSwallower();
 }