コード例 #1
0
        public void DisposePendingNotificationClientRequest()
        {
            IMailboxContext mailboxContext = UserContextManager.GetMailboxContext(HttpContext.Current, null, false);
            HttpResponse    response       = HttpContext.Current.Response;
            object          parameter      = base.GetParameter("Fn");
            bool            flag           = false;

            if (parameter != null)
            {
                flag = (bool)parameter;
            }
            bool   flag2 = false;
            string text  = (string)base.GetParameter("cid");

            text = this.ProcessChannelIdOnRequestAndGenerateIfNeeded(text, flag);
            if (mailboxContext != null && text != null)
            {
                PendingRequestChannel pendingGetChannel = mailboxContext.PendingRequestManager.GetPendingGetChannel(text);
                if (pendingGetChannel != null)
                {
                    flag2 = pendingGetChannel.HandleFinishRequestFromClient();
                    if (flag)
                    {
                        ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[PendingRequestEventHandler::DisposePendingNotificationClientRequest] userContext.PendingRequestManager.RemovePendingGetChannel. ChannelId: {0}", text);
                        mailboxContext.PendingRequestManager.RemovePendingGetChannel(text);
                    }
                }
                else
                {
                    mailboxContext.PendingRequestManager.AddPendingGetChannel(text);
                }
            }
            response.AppendHeader("X-OWA-EventResult", "0");
            response.Write("{");
            if (text != null)
            {
                response.Write("cid:\"");
                response.Write(text);
                response.Write("\",");
            }
            response.Write("syncFnshRq:");
            response.Write(flag2 ? "1}" : "0}");
            HttpUtilities.MakePageNoCacheNoStore(response);
            response.ContentType = HttpUtilities.GetContentTypeString(base.ResponseContentType);
        }