/// <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); }
/// <summary> /// Initializes the <see cref="ExceptionSwallower"/> class. /// </summary> static ExceptionSwallower() { // Set the default ExceptionSwallower instance _instance = new ExceptionSwallower(); }
/// <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; }