public static System.IO.Stream CreateTemporaryStorage(System.Func<int, byte[]> acquireBuffer, System.Action<byte[]> releaseBuffer)
 {
     var temporaryDataStorage = new TemporaryDataStorage(acquireBuffer, releaseBuffer);
     System.IO.Stream stream = temporaryDataStorage.OpenWriteStream(false);
     temporaryDataStorage.Release();
     return stream;
 }
Beispiel #2
0
        internal Stream GetWriteStream()
        {
            TemporaryDataStorage temporaryDataStorage = new TemporaryDataStorage();

            this.SetStorage(temporaryDataStorage, 0L, long.MaxValue);
            return(temporaryDataStorage.OpenWriteStream(true));
        }
Beispiel #3
0
        public static Stream Create()
        {
            TemporaryDataStorage temporaryDataStorage = new TemporaryDataStorage();
            Stream result = temporaryDataStorage.OpenWriteStream(false);

            temporaryDataStorage.Release();
            return(result);
        }
 private string GetTempFilePath()
 {
     return(TemporaryDataStorage.GetTempPath());
 }
 internal void Load(CalendarReader reader, Charset charset)
 {
     while (reader.ReadNextComponent())
     {
         if (ComponentId.VEvent == reader.ComponentId)
         {
             CalendarPropertyReader propertyReader = reader.PropertyReader;
             while (propertyReader.ReadNextProperty())
             {
                 PropertyId propertyId = propertyReader.PropertyId;
                 if (this.dirty.ContainsKey(propertyId) && !this.properties.ContainsKey(propertyId))
                 {
                     if (PropertyId.Description == propertyId || PropertyId.Comment == propertyId)
                     {
                         byte[] array = null;
                         TemporaryDataStorage temporaryDataStorage = new TemporaryDataStorage();
                         using (Stream stream = temporaryDataStorage.OpenWriteStream(true))
                         {
                             using (Stream valueReadStream = propertyReader.GetValueReadStream())
                             {
                                 DataStorage.CopyStreamToStream(valueReadStream, stream, long.MaxValue, ref array);
                             }
                         }
                         BodyData bodyData = new BodyData();
                         bodyData.SetFormat(BodyFormat.Text, InternalBodyFormat.Text, charset);
                         bodyData.SetStorage(temporaryDataStorage, 0L, long.MaxValue);
                         temporaryDataStorage.Release();
                         this.properties[propertyId] = bodyData;
                     }
                     else if (PropertyId.Attendee == propertyId)
                     {
                         CalendarParameterReader parameterReader = propertyReader.ParameterReader;
                         while (parameterReader.ReadNextParameter())
                         {
                             if (parameterReader.ParameterId == ParameterId.ParticipationStatus)
                             {
                                 this.properties[propertyId] = parameterReader.ReadValue();
                             }
                         }
                     }
                     else
                     {
                         this.properties[propertyId] = propertyReader.ReadValue();
                     }
                 }
             }
         }
         if (ComponentId.VCalendar == reader.ComponentId)
         {
             CalendarPropertyReader propertyReader2 = reader.PropertyReader;
             while (propertyReader2.ReadNextProperty())
             {
                 PropertyId propertyId2 = propertyReader2.PropertyId;
                 if (PropertyId.Method == propertyId2)
                 {
                     this.properties[propertyId2] = propertyReader2.ReadValue();
                 }
             }
         }
     }
 }
Beispiel #6
0
 // Token: 0x0600022F RID: 559 RVA: 0x0000767B File Offset: 0x0000587B
 internal static string GetCtsTempPath()
 {
     return(TemporaryDataStorage.GetTempPath());
 }
Beispiel #7
0
 // Token: 0x0600022E RID: 558 RVA: 0x0000766E File Offset: 0x0000586E
 internal static void ConfigureTempStorage(int defaultMaximumSize, int defaultBlockSize, string defaultPath, Func <int, byte[]> defaultAcquireBuffer, Action <byte[]> defaultReleaseBuffer)
 {
     TemporaryDataStorage.Configure(defaultMaximumSize, defaultBlockSize, defaultPath, defaultAcquireBuffer, defaultReleaseBuffer);
 }