Beispiel #1
0
        public static void LogException(this ILogging log, System.Exception exception)
        {
            if (exception == null || IDisposedExtensions.IsNullOrDisposed(log))
            {
                return;
            }

            log.LogException(exception);
        }
Beispiel #2
0
        public static void Log(this ILogging log, string message)
        {
            if (string.IsNullOrEmpty(message) || IDisposedExtensions.IsNullOrDisposed(log))
            {
                return;
            }

            log.Log(message);
        }
Beispiel #3
0
        public static void SetShouldDispose(BaseDisposable toDispose, bool value, bool callDispose = false)
        {
            if (IDisposedExtensions.IsNullOrDisposed(toDispose))
            {
                return;
            }

            toDispose.ShouldDispose = value;

            if (callDispose)
            {
                toDispose.Dispose();
            }
        }