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

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

            log.Log(message);
        }
示例#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();
            }
        }