Exemple #1
0
 private void AddProviderInternal(CallContext callContext, PolymorphicConfiguration <AttachmentDataProvider> attachmentDataProvidersConfig, AttachmentDataProvider provider)
 {
     lock (this.lockObject)
     {
         this.dataProviders[provider.Id] = provider;
         if (attachmentDataProvidersConfig != null)
         {
             attachmentDataProvidersConfig.Entries.Add(provider);
             attachmentDataProvidersConfig.Save(callContext);
         }
     }
 }
Exemple #2
0
 private void ProviderChanged(AttachmentDataProvider provider, AttachmentDataProviderChangedEventArgs args)
 {
     if (this.dataProviders.ContainsKey(provider.Id))
     {
         lock (this.lockObject)
         {
             if (this.dataProviders.ContainsKey(provider.Id))
             {
                 PolymorphicConfiguration <AttachmentDataProvider> polymorphicConfiguration = new PolymorphicConfiguration <AttachmentDataProvider>();
                 foreach (AttachmentDataProvider item in this.dataProviders.Values)
                 {
                     polymorphicConfiguration.Entries.Add(item);
                     polymorphicConfiguration.Save(args.MailboxSession);
                 }
             }
         }
     }
 }