// Token: 0x06000D74 RID: 3444 RVA: 0x00032F68 File Offset: 0x00031168
 public void Write(string notificationString)
 {
     if (notificationString == null)
     {
         throw new ArgumentNullException();
     }
     if (this.evalChunksNotSupportedByXmlhttpRequest)
     {
         this.ChunkWrite(string.Format(CultureInfo.InvariantCulture, "<script>var y=parent;if(y){{var x=y.pR;if(x) x(\"{0}\");}}</script>\r\n", new object[]
         {
             PendingRequestUtilities.JavascriptEncode(notificationString)
         }), NotificationChunkOrder.Mid);
         return;
     }
     this.ChunkWrite(string.Format(CultureInfo.InvariantCulture, "<script>{0}</script>\r\n", new object[]
     {
         PendingRequestUtilities.JavascriptEscapeNonAscii(notificationString)
     }), NotificationChunkOrder.Mid);
 }
Пример #2
0
        public void EndUseNotificationPipe(IAsyncResult async)
        {
            if (this.isDisposing)
            {
                return;
            }
            OwaAsyncResult owaAsyncResult = (OwaAsyncResult)async;

            try
            {
                string pendingGetId = owaAsyncResult.PendingGetId;
                PendingRequestEventData pendingRequestEventData;
                if (!this.pgEventDataDictionary.TryGetValue(pendingGetId, out pendingRequestEventData))
                {
                    ExTraceGlobals.NotificationsCallTracer.TraceWarning <string>((long)this.GetHashCode(), "There is no PendingRequestEventData for PendingGetId {0}", pendingGetId);
                }
                else
                {
                    if (owaAsyncResult.Exception != null)
                    {
                        Exception ex = (owaAsyncResult.Exception.InnerException == null) ? owaAsyncResult.Exception : owaAsyncResult.Exception.InnerException;
                        ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "An exception was thrown during the processing of the async request: {0}", ex.Message);
                        if (pendingRequestEventData.Response != null)
                        {
                            StringBuilder stringBuilder = new StringBuilder(500);
                            stringBuilder.Append(ex.Message);
                            stringBuilder.Append(":").Append(ex.StackTrace);
                            pendingRequestEventData.Response.WriteError(PendingRequestUtilities.JavascriptEncode(stringBuilder.ToString()));
                        }
                    }
                    if (pendingRequestEventData.Response != null)
                    {
                        pendingRequestEventData.Response.WriteLastChunk();
                    }
                }
            }
            catch (OwaPermanentException)
            {
            }
        }
 // Token: 0x06000EF9 RID: 3833 RVA: 0x0003A4F0 File Offset: 0x000386F0
 public static string JavascriptEncode(string s)
 {
     return(PendingRequestUtilities.JavascriptEncode(s, true));
 }