// 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);
 }
Exemple #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)
            {
            }
        }
 public void Save(MailboxSession mailboxSession)
 {
     using (UserConfiguration userConfiguration = this.GetUserConfiguration(this.configurationAttribute.ConfigurationName, mailboxSession))
     {
         using (Stream xmlStream = userConfiguration.GetXmlStream())
         {
             xmlStream.SetLength(0L);
             using (StreamWriter streamWriter = PendingRequestUtilities.CreateStreamWriter(xmlStream))
             {
                 using (XmlTextWriter xmlTextWriter = new XmlTextWriter(streamWriter))
                 {
                     xmlTextWriter.WriteStartElement(this.configurationAttribute.ConfigurationRootNodeName);
                     foreach (T t in this.entries)
                     {
                         SimpleConfigurationAttribute simpleConfigurationAttribute;
                         lock (SimpleConfiguration <T> .simpleConfigurationTable)
                         {
                             simpleConfigurationAttribute = SimpleConfiguration <T> .simpleConfigurationTable[t.GetType()];
                         }
                         xmlTextWriter.WriteStartElement("entry");
                         this.WriteCustomAttributes(xmlTextWriter, t);
                         foreach (SimpleConfigurationPropertyAttribute simpleConfigurationPropertyAttribute in simpleConfigurationAttribute.GetPropertyCollection())
                         {
                             object value = simpleConfigurationPropertyAttribute.GetValue(t);
                             if (value != null)
                             {
                                 xmlTextWriter.WriteAttributeString(simpleConfigurationPropertyAttribute.Name, value.ToString());
                             }
                         }
                         xmlTextWriter.WriteFullEndElement();
                     }
                     xmlTextWriter.WriteFullEndElement();
                 }
             }
         }
         this.TrySaveConfiguration(userConfiguration, true);
     }
 }
 // Token: 0x06000D6B RID: 3435 RVA: 0x00032D30 File Offset: 0x00030F30
 internal ChunkedHttpResponse(HttpContext context)
 {
     this.Response = context.Response;
     HttpUtilities.MakePageNoCacheNoStore(this.Response);
     this.evalChunksNotSupportedByXmlhttpRequest = (HttpUtilities.GetQueryStringParameter(context.Request, "ecnsq", false) == "1");
     this.browserNameQueryParamValue             = HttpUtilities.GetQueryStringParameter(context.Request, "brwnm", false);
     this.userAgent = new UserAgent(context.Request.UserAgent, UserContextManager.GetUserContext(context).FeaturesManager.ClientServerSettings.ChangeLayout.Enabled, context.Request.Cookies);
     this.accountValidationContext = (context.Items["AccountValidationContext"] as IAccountValidationContext);
     this.Response.BufferOutput    = false;
     this.Response.Buffer          = false;
     this.Response.ContentType     = "text/html; charset=UTF-8";
     this.Response.AddHeader("Transfer-Encoding", "chunked");
     if ((string.Equals("iPhone", this.userAgent.Platform) || string.Equals("iPad", this.userAgent.Platform)) && ((this.userAgent.Browser == "Safari" && this.userAgent.BrowserVersion.Build > 5) || this.browserNameQueryParamValue == "safari"))
     {
         this.Response.AddHeader("X-FromBackEnd-ClientConnection", "close");
     }
     if (!this.evalChunksNotSupportedByXmlhttpRequest)
     {
         this.Response.TrySkipIisCustomErrors = true;
     }
     this.streamWriter = PendingRequestUtilities.CreateStreamWriter(this.Response.OutputStream);
     this.WriteFirstChunk();
 }
 // Token: 0x06000EF9 RID: 3833 RVA: 0x0003A4F0 File Offset: 0x000386F0
 public static string JavascriptEncode(string s)
 {
     return(PendingRequestUtilities.JavascriptEncode(s, true));
 }