/// <summary> /// Prevents a default instance of the <see cref="DirectoryEntry"/> class from being created. /// </summary> /// <param name="identifier">The entry identifier.</param> /// <param name="flags">The entry flags.</param> /// <param name="recordingDate">The entry recording date.</param> /// <param name="length">The entry length.</param> private DirectoryEntry(string identifier, DirectoryEntryFlags flags, DateTimeOffset?recordingDate, uint length) : base(GetFileName(identifier), GetAttributes(flags), GetModifyDate(recordingDate), length) { this.Identifier = identifier; this.FileFlags = flags; this.RecordingDate = recordingDate; this.DataLength = length; }
/// <summary> /// Returns VirtualFileAttributes based on DirectoryEntryFlags. /// </summary> /// <param name="flags">Directory entry flags to convert.</param> /// <returns>Virtual file attributes based on the specified directory entry flags.</returns> private static VirtualFileAttributes GetAttributes(DirectoryEntryFlags flags) { var attributes = VirtualFileAttributes.Default; if ((flags & DirectoryEntryFlags.Hidden) != 0) { attributes |= VirtualFileAttributes.Hidden; } if ((flags & DirectoryEntryFlags.Directory) != 0) { attributes |= VirtualFileAttributes.Directory; } return(attributes); }