Пример #1
0
        /// <summary>
        ///		Create new instance.
        /// </summary>
        public DefaultObjectFactory()
        {
            _compressors = new Dictionary <string, ICoder>();
            _encryptors  = new Dictionary <string, ICoder>();

            ICoder defaultCoder = new DeflateCoder();

            AddCompressor(defaultCoder, false);
            this.DefaultCompressor = defaultCoder.KeyCode;
            _dataFoldersDepth      = CalendarHistoricalFoldersTraits.defaultDepth;


            // can use new StandardDirectoryProvider() new StandardFileProvider()
            FileSystemProvider = new bfs.Repository.IO.WinNtfs.WinLongFileSystemProvider();
        }
 /// <summary>
 ///		Check the validity of the data folders tree depth setting.
 /// </summary>
 /// <param name="depth">
 ///		A <see cref="DataFolderLevel"/> representing the lowest level of the data folders tree.
 /// </param>
 /// <exception cref="ArgumentException">
 ///		The depth value is invalid.
 /// </exception>
 public static void CheckDepth(DataFolderLevel depth)
 {
     Check.DoAssertLambda((int)depth >= Constants.DataFolderLevelLeaf && (int)depth <= maxAllowedAbsoluteStartLevel
                          , () => new ArgumentException(StorageResources.DataFoldersDepthInvalid));
 }
 /// <summary>
 ///		 Create new instance
 /// </summary>
 /// <param name="depth">
 ///     Lowest level in the directory tree. Note that highest level is always Year. Must be <see cref="DataFolderLevel.Month"/> or lower.
 /// </param>
 /// <param name="repository">
 ///     Owning repository.
 /// </param>
 public CalendarHistoricalFoldersTraits(DataFolderLevel depth, IRepository repository)
 {
     CheckDepth(depth);
     _startLevel = (int)depth;
     Repository  = repository;
 }