Exemplo n.º 1
0
        //public virtual event EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>> MessageContextRemoved
        //{
        //	add
        //	{
        //		EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>> eventHandler = this.MessageContextRemoved;
        //		EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>> eventHandler2;
        //		do
        //		{
        //			eventHandler2 = eventHandler;
        //			EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>> value2 = (EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>>)Delegate.Combine(eventHandler2, value);
        //			eventHandler = Interlocked.CompareExchange<EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>>>(ref this.MessageContextRemoved, value2, eventHandler2);
        //		}
        //		while ((object)eventHandler != eventHandler2);
        //	}
        //	remove
        //	{
        //		EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>> eventHandler = this.MessageContextRemoved;
        //		EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>> eventHandler2;
        //		do
        //		{
        //			eventHandler2 = eventHandler;
        //			EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>> value2 = (EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>>)Delegate.Remove(eventHandler2, value);
        //			eventHandler = Interlocked.CompareExchange<EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>>>(ref this.MessageContextRemoved, value2, eventHandler2);
        //		}
        //		while ((object)eventHandler != eventHandler2);
        //	}
        //}

        private void OnMessageContextRemoved(WeixinContextRemovedEventArgs <TRequest, TResponse> e)
        {
            EventHandler <WeixinContextRemovedEventArgs <TRequest, TResponse> > messageContextRemoved = this.MessageContextRemoved;

            if (messageContextRemoved != null)
            {
                messageContextRemoved(this, e);
            }
        }
Exemplo n.º 2
0
        public virtual void OnRemoved()
        {
            WeixinContextRemovedEventArgs <TRequest, TResponse> e = new WeixinContextRemovedEventArgs <TRequest, TResponse>(this);

            this.OnMessageContextRemoved(e);
        }