Esempio n. 1
0
        protected DirectoryEntry([NotNull] string name, FileAttributes attributes, [CanBeNull] DirectoryEntry parent,
                                 [CanBeNull] VolumeEntry root, [NotNull] FakeFileSystemChangeTracker changeTracker, [NotNull] SystemClock systemClock,
                                 [NotNull] ILoggedOnUserAccount loggedOnAccount)
            : base(name, attributes, changeTracker, loggedOnAccount)
        {
            Guard.NotNull(systemClock, nameof(systemClock));

            Parent        = parent;
            Root          = root ?? (VolumeEntry)this;
            SystemClock   = systemClock;
            PathFormatter = new DirectoryEntryPathFormatter(this);

            if (parent?.IsEncrypted == true)
            {
                SetEncrypted();
            }

            CreationTimeUtc = systemClock.UtcNow();
            UpdateLastWriteLastAccessTime();
        }
Esempio n. 2
0
 private void UpdateLastAccessTime()
 {
     LastAccessTimeUtc = SystemClock.UtcNow();
 }
Esempio n. 3
0
        private static Random CreateRandomNumberGenerator([NotNull] SystemClock systemClock)
        {
            int seed = (int)(systemClock.UtcNow().Ticks % int.MaxValue);

            return(new Random(seed));
        }