private void PSHttpListener_Closing(object sender, PSHttpListenerCloseEventArgs e) { PSHttpListener listener; if (sender != null && (listener = _listener) != null && ReferenceEquals(sender, listener)) { _listener = null; listener.Closing -= PSHttpListener_Closing; } }
public bool Equals(PSHttpHandlerInfo other) { if (other == null) { return(false); } PSHttpListener x = _listener; PSHttpListener y = other._listener; if (x == null) { if (y != null) { return(false); } } else if (y == null || !ReferenceEquals(x, y)) { return(false); } return(NameComparer.Equals(_handler.Name, other._handler.Name)); }
internal virtual void OnRegistered(PSCmdlet hostCmdlet, PSHttpListener listener) { }
internal PSHttpHandlerInfo(PSHttpListener listener, PSHttpHandler handler) { _listener = listener; _handler = handler; listener.Closing += PSHttpListener_Closing; }