Refactored HttpListenerPrefixCollection.cs
This commit is contained in:
parent
7a8967bdcd
commit
29fa277cdc
@ -139,8 +139,8 @@ namespace WebSocketSharp.Net
|
|||||||
/// </exception>
|
/// </exception>
|
||||||
public void Add (string uriPrefix)
|
public void Add (string uriPrefix)
|
||||||
{
|
{
|
||||||
ListenerPrefix.CheckUriPrefix (uriPrefix);
|
|
||||||
_listener.CheckDisposed ();
|
_listener.CheckDisposed ();
|
||||||
|
ListenerPrefix.CheckUriPrefix (uriPrefix);
|
||||||
|
|
||||||
if (_prefixes.Contains (uriPrefix))
|
if (_prefixes.Contains (uriPrefix))
|
||||||
return;
|
return;
|
||||||
@ -184,10 +184,10 @@ namespace WebSocketSharp.Net
|
|||||||
/// </exception>
|
/// </exception>
|
||||||
public bool Contains (string uriPrefix)
|
public bool Contains (string uriPrefix)
|
||||||
{
|
{
|
||||||
|
_listener.CheckDisposed ();
|
||||||
if (uriPrefix == null)
|
if (uriPrefix == null)
|
||||||
throw new ArgumentNullException ("uriPrefix");
|
throw new ArgumentNullException ("uriPrefix");
|
||||||
|
|
||||||
_listener.CheckDisposed ();
|
|
||||||
return _prefixes.Contains (uriPrefix);
|
return _prefixes.Contains (uriPrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,11 +259,10 @@ namespace WebSocketSharp.Net
|
|||||||
/// </exception>
|
/// </exception>
|
||||||
public bool Remove (string uriPrefix)
|
public bool Remove (string uriPrefix)
|
||||||
{
|
{
|
||||||
|
_listener.CheckDisposed ();
|
||||||
if (uriPrefix == null)
|
if (uriPrefix == null)
|
||||||
throw new ArgumentNullException ("uriPrefix");
|
throw new ArgumentNullException ("uriPrefix");
|
||||||
|
|
||||||
_listener.CheckDisposed ();
|
|
||||||
|
|
||||||
var res = _prefixes.Remove (uriPrefix);
|
var res = _prefixes.Remove (uriPrefix);
|
||||||
if (res && _listener.IsListening)
|
if (res && _listener.IsListening)
|
||||||
EndPointManager.RemovePrefix (uriPrefix, _listener);
|
EndPointManager.RemovePrefix (uriPrefix, _listener);
|
||||||
|
Loading…
Reference in New Issue
Block a user