WebSocketSharp.Net.HttpListener.CheckDisposed C# (CSharp) Method

CheckDisposed() private method

private CheckDisposed ( ) : void
return void
        internal void CheckDisposed()
        {
            if (disposed)
                throw new ObjectDisposedException (GetType ().ToString ());
        }

Usage Example

        /// <summary>
        /// Adds the specified URI prefix to the collection.
        /// </summary>
        /// <param name="uriPrefix">
        ///   <para>
        ///   A <see cref="string"/> that specifies the URI prefix to add.
        ///   </para>
        ///   <para>
        ///   It must be a well-formed URI prefix with http or https scheme,
        ///   and must end with a '/'.
        ///   </para>
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="uriPrefix"/> is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentException">
        /// <paramref name="uriPrefix"/> is invalid.
        /// </exception>
        /// <exception cref="ObjectDisposedException">
        /// The <see cref="HttpListener"/> instance associated with this
        /// collection is closed.
        /// </exception>
        public void Add(string uriPrefix)
        {
            _listener.CheckDisposed();

            HttpListenerPrefix.CheckPrefix(uriPrefix);

            if (_prefixes.Contains(uriPrefix))
            {
                return;
            }

            if (_listener.IsListening)
            {
                EndPointManager.AddPrefix(uriPrefix, _listener);
            }

            _prefixes.Add(uriPrefix);
        }
All Usage Examples Of WebSocketSharp.Net.HttpListener::CheckDisposed