예제 #1
0
 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();
 }