Пример #1
0
 internal static ConfigurableObject Fill(ConfigurableObject configObject, ProviderPropertyDefinition[] appliedProperties, UserConfigurationDictionaryHelper.GetDictionaryUserConfigurationDelegate getDictionaryUserConfigurationDelegate)
 {
     Util.ThrowOnNullArgument(configObject, "configObject");
     Util.ThrowOnNullArgument(appliedProperties, "appliedProperties");
     using (UserConfiguration userConfiguration = getDictionaryUserConfigurationDelegate(false))
     {
         if (userConfiguration == null)
         {
             return(null);
         }
         UserConfigurationDictionaryHelper.Fill(userConfiguration, configObject, appliedProperties);
     }
     return(configObject);
 }
        protected override IEnumerable <T> InternalFindPaged <T>(QueryFilter filter, ObjectId rootId, bool deepSearch, SortBy sortBy, int pageSize)
        {
            if (sortBy != null)
            {
                throw new NotSupportedException("sortBy");
            }
            if (rootId == null)
            {
                throw new NotSupportedException("rootId must be specified");
            }
            if (!(rootId is MailboxFolderId))
            {
                throw new NotSupportedException("rootId: " + rootId.GetType().FullName);
            }
            if (!typeof(MailboxCalendarFolder).GetTypeInfo().IsAssignableFrom(typeof(T).GetTypeInfo()))
            {
                throw new NotSupportedException("FindPaged: " + typeof(T).FullName);
            }
            MailboxFolderId mailboxFolderId = (MailboxFolderId)rootId;
            StoreObjectId   folderId        = mailboxFolderId.StoreObjectIdValue ?? base.ResolveStoreObjectIdFromFolderPath(mailboxFolderId.MailboxFolderPath);

            if (folderId == null)
            {
                throw new CantFindCalendarFolderException(mailboxFolderId);
            }
            using (Folder folder = Folder.Bind(base.MailboxSession, folderId))
            {
                if (!StringComparer.OrdinalIgnoreCase.Equals(folder.ClassName, "IPF.Appointment"))
                {
                    throw new CantFindCalendarFolderException(mailboxFolderId);
                }
            }
            MailboxCalendarFolder mailboxCalendarFolder = (MailboxCalendarFolder)((object)((default(T) == null) ? Activator.CreateInstance <T>() : default(T)));

            mailboxCalendarFolder.MailboxFolderId = mailboxFolderId;
            UserConfigurationDictionaryHelper.Fill(mailboxCalendarFolder, MailboxCalendarFolder.CalendarFolderConfigurationProperties, (bool createIfNonexisting) => UserConfigurationHelper.GetPublishingConfiguration(this.MailboxSession, folderId, createIfNonexisting));
            yield return((T)((object)mailboxCalendarFolder));

            yield break;
        }
Пример #3
0
 protected override void InternalFill(TObject configObject)
 {
     base.InternalFill(configObject);
     UserConfigurationDictionaryHelper.Fill(configObject, this.AppliedProperties.ToArray(), (bool createIfNonexisting) => this.ConfigurationGetter(base.Session, base.Configuration, UserConfigurationTypes.Dictionary, createIfNonexisting));
 }