Ejemplo n.º 1
0
        public OutlookTaskRepository(NameSpace mapiNameSpace, string folderId, string folderStoreId, IDaslFilterProvider daslFilterProvider, TaskMappingConfiguration configuration, IQueryOutlookTaskItemFolderStrategy queryFolderStrategy)
        {
            if (mapiNameSpace == null)
            {
                throw new ArgumentNullException(nameof(mapiNameSpace));
            }
            if (daslFilterProvider == null)
            {
                throw new ArgumentNullException(nameof(daslFilterProvider));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (queryFolderStrategy == null)
            {
                throw new ArgumentNullException(nameof(queryFolderStrategy));
            }
            if (String.IsNullOrEmpty(folderId))
            {
                throw new ArgumentException("Argument is null or empty", nameof(folderId));
            }
            if (String.IsNullOrEmpty(folderStoreId))
            {
                throw new ArgumentException("Argument is null or empty", nameof(folderStoreId));
            }

            _mapiNameSpace       = mapiNameSpace;
            _folderId            = folderId;
            _folderStoreId       = folderStoreId;
            _daslFilterProvider  = daslFilterProvider;
            _configuration       = configuration;
            _queryFolderStrategy = queryFolderStrategy;
        }
        public OutlookTaskRepository(IOutlookSession session, string folderId, string folderStoreId, IDaslFilterProvider daslFilterProvider, TaskMappingConfiguration configuration, IQueryOutlookTaskItemFolderStrategy queryFolderStrategy, IComWrapperFactory comWrapperFactory, bool useDefaultFolderItemType)
        {
            if (session == null)
            {
                throw new ArgumentNullException(nameof(session));
            }
            if (daslFilterProvider == null)
            {
                throw new ArgumentNullException(nameof(daslFilterProvider));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            if (queryFolderStrategy == null)
            {
                throw new ArgumentNullException(nameof(queryFolderStrategy));
            }
            if (comWrapperFactory == null)
            {
                throw new ArgumentNullException(nameof(comWrapperFactory));
            }
            if (String.IsNullOrEmpty(folderId))
            {
                throw new ArgumentException("Argument is null or empty", nameof(folderId));
            }
            if (String.IsNullOrEmpty(folderStoreId))
            {
                throw new ArgumentException("Argument is null or empty", nameof(folderStoreId));
            }

            _session                  = session;
            _folderId                 = folderId;
            _folderStoreId            = folderStoreId;
            _daslFilterProvider       = daslFilterProvider;
            _configuration            = configuration;
            _queryFolderStrategy      = queryFolderStrategy;
            _comWrapperFactory        = comWrapperFactory;
            _useDefaultFolderItemType = useDefaultFolderItemType;
        }