Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AppConfig"/> class.
        /// </summary>
        /// <param name="cleanupDirectoryPath">
        /// The path to the directory to cleanup.
        /// </param>
        /// <param name="retentionRules">
        /// The sequence of retention rules.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="cleanupDirectoryPath"/> is <see langword="null"/> or empty or whitespace or
        /// <paramref name="retentionRules"/> is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentException">
        /// <paramref name="retentionRules"/> contains a <see langword="null"/> item.
        /// </exception>
        public AppConfig(
            [NotNull] string cleanupDirectoryPath,
            [NotNull, ItemNotNull] IReadOnlyCollection <RetentionRule> retentionRules)
        {
            AssertArg.NotNullOrWhiteSpace(cleanupDirectoryPath, nameof(cleanupDirectoryPath));
            AssertArg.NotNull(retentionRules, nameof(retentionRules));
            AssertArg.NoNullItems(retentionRules, nameof(retentionRules));

            CleanupDirectoryPath = cleanupDirectoryPath;
            RetentionRules       = retentionRules.ToReadOnlyList();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DirectoryFileStorageSettings"/> class.
        /// </summary>
        /// <param name="directoryPath">
        /// The directory where to perform a cleanup.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="directoryPath"/> is <see langword="null"/> or empty, or whitespace.
        /// </exception>
        public DirectoryFileStorageSettings([NotNull] string directoryPath)
        {
            AssertArg.NotNullOrWhiteSpace(directoryPath, nameof(directoryPath));

            DirectoryPath = directoryPath;
        }