// Token: 0x06000A11 RID: 2577 RVA: 0x000422A4 File Offset: 0x000404A4
 internal void SaveSerializedData(Stream source)
 {
     lock (this.systemMailboxMutex)
     {
         if (!this.isDisposed)
         {
             this.ConnectSystemMailboxSession();
             try
             {
                 using (Folder folder = Folder.Bind(this.systemMailboxSession, this.TextSettingsFolderId))
                 {
                     using (UserConfiguration userConfiguration = UserConfiguration.Create(folder, new UserConfigurationName("CalendarNotificationSerializedData", ConfigurationNameKind.ItemClass), UserConfigurationTypes.Stream))
                     {
                         using (Stream stream = userConfiguration.GetStream())
                         {
                             byte[] array = new byte[1024];
                             int    count;
                             while ((count = source.Read(array, 0, array.Length)) > 0)
                             {
                                 stream.Write(array, 0, count);
                             }
                             userConfiguration.Save();
                         }
                     }
                 }
             }
             finally
             {
                 this.DisconnectSystemMailboxSession();
             }
         }
     }
 }
Example #2
0
        MmasfContext()
        {
            ConfigurationCache = new CompoundCache <Configuration>
                                 (
                () => new Configuration(),
                ConfigurationWatcherCache
                                 );
            ConfigurationWatcherCache = new CompoundCache <DirectoryWatcher>(CreateConfigurationWatcher);
            ModConfigurationCache     = new CompoundCache <ModConfiguration>(ModConfiguration.Create);
            ModDictionary             = new FunctionCache <string, FunctionCache <Version, ModDescription> >(CreateModDescription);
            SystemConfigurationCache  = new CompoundCache <SystemConfiguration>(() => new SystemConfiguration());

            SystemConfigurationFileCache = new CompoundCache <SystemConfigurationFile>
                                           (
                () => new SystemConfigurationFile(Configuration.SystemFile),
                ConfigurationCache
                                           );

            DataConfigurationCache = new CompoundCache <DataConfiguration>
                                     (
                () =>
                new DataConfiguration(SystemConfigurationFile.ConfigurationPath, OnExternalModification),
                SystemConfigurationFileCache
                                     );

            UserConfigurationsCache = new CompoundCache <UserConfiguration[]>
                                      (
                () =>
                Configuration
                .UserConfigurationPaths
                .Select
                (
                    item =>
                    UserConfiguration
                    .Create(item, Configuration.UserConfigurationPaths, this)
                )
                .ToArray()
                                      );
        }