Пример #1
0
        public static void NotDisposed(IDisposableObservable disposedValue, string?message = null)
        {
            Requires.NotNull(disposedValue, nameof(disposedValue));

            if (disposedValue.IsDisposed)
            {
                string objectName = disposedValue.GetType().FullName;
                if (message is object)
                {
                    throw new ObjectDisposedException(objectName, message);
                }
                else
                {
                    throw new ObjectDisposedException(objectName);
                }
            }
        }
Пример #2
0
        public static void NotDisposed(IDisposableObservable disposedValue, string message = null)
        {
            Requires.NotNull(disposedValue, "disposedValue");

            if (disposedValue.IsDisposed)
            {
                string objectName = disposedValue != null ? disposedValue.GetType().FullName : string.Empty;
                if (message != null)
                {
                    throw new ObjectDisposedException(objectName, message);
                }
                else
                {
                    throw new ObjectDisposedException(objectName);
                }
            }
        }
Пример #3
0
        public static void NotDisposed(IDisposableObservable disposedValue, string message = null)
        {
            Requires.NotNull(disposedValue, "disposedValue");

            if (disposedValue.IsDisposed)
            {
                string objectName = disposedValue != null?disposedValue.GetType().FullName : string.Empty;

                if (message != null)
                {
                    throw new ObjectDisposedException(objectName, message);
                }
                else
                {
                    throw new ObjectDisposedException(objectName);
                }
            }
        }