コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 internal virtual void OnRegistered(PSCmdlet hostCmdlet, PSHttpListener listener)
 {
 }
コード例 #4
0
 internal PSHttpHandlerInfo(PSHttpListener listener, PSHttpHandler handler)
 {
     _listener         = listener;
     _handler          = handler;
     listener.Closing += PSHttpListener_Closing;
 }