コード例 #1
0
        public BackupSettings(
            PathAndSpecialFolder directory,
            bool isCreatingBackups,
            string extension,
            string timeStampFormat,
            bool hidden,
            int numberOfBackups,
            int maxAgeInDays)
            : base(directory, extension)
        {
            if (isCreatingBackups)
            {
                Ensure.NotNull(directory, nameof(directory));
                Ensure.NotNullOrEmpty(extension, nameof(extension));
                ValidateTimestampFormat(timeStampFormat);
            }
            _isCreatingBackups = isCreatingBackups;

            if (!string.IsNullOrWhiteSpace(timeStampFormat))
            {
                _timeStampFormat = timeStampFormat;
            }
            if (numberOfBackups > 1)
            {
                _timeStampFormat = DefaultTimeStampFormat;
            }

            _hidden          = hidden;
            _numberOfBackups = numberOfBackups;
            _maxAgeInDays    = maxAgeInDays;
        }
コード例 #2
0
 public RepositorySettings(
     DirectoryInfo directory,
     bool isTrackingDirty,
     bool isCaching,
     BackupSettings backupSettings,
     string extension     = ".cfg",
     string tempExtension = ".tmp")
     : this(
         PathAndSpecialFolder.Create(directory),
         isTrackingDirty,
         isCaching,
         backupSettings,
         extension,
         tempExtension)
 {
 }
コード例 #3
0
 public BackupSettings(
     DirectoryInfo directory,
     bool isCreatingBackups,
     string extension,
     string timeStampFormat,
     bool hidden,
     int numberOfBackups,
     int maxAgeInDays)
     : this(
         directory != null ? PathAndSpecialFolder.Create(directory) : null,
         isCreatingBackups,
         extension,
         timeStampFormat,
         hidden,
         numberOfBackups,
         maxAgeInDays)
 {
 }
コード例 #4
0
        public RepositorySettings(
            PathAndSpecialFolder directory,
            bool isTrackingDirty,
            bool isCaching,
            BackupSettings backupSettings,
            string extension     = ".cfg",
            string tempExtension = ".tmp")
            : base(directory, extension)
        {
            Ensure.NotNullOrEmpty(extension, nameof(extension));
            Ensure.NotNullOrEmpty(tempExtension, nameof(tempExtension));
            Ensure.NotNull(directory, nameof(directory));

            _isTrackingDirty = isTrackingDirty;
            _isCaching       = isCaching;
            _backupSettings  = backupSettings;
            _tempExtension   = FileHelper.PrependDotIfMissing(tempExtension);
        }
コード例 #5
0
 public FileSettings(DirectoryInfo directory, string extension)
 {
     _directoryPath = PathAndSpecialFolder.Create(directory);
     _extension     = FileHelper.PrependDotIfMissing(extension);
 }
コード例 #6
0
 public FileSettings(PathAndSpecialFolder directoryPath, string extension)
 {
     _directoryPath = directoryPath;
     _extension     = FileHelper.PrependDotIfMissing(extension);
 }