/// <summary>
        /// 构造一个 <see cref="PhysicalStorageDirectoryContents"/>。
        /// </summary>
        /// <param name="contents">给定的 <see cref="IDirectoryContents"/>。</param>
        public PhysicalStorageDirectoryContents(IDirectoryContents contents)
        {
            contents.NotEmpty(nameof(contents));

            _entries = contents.Select <IFileInfo, IStorageFileInfo>(info =>
            {
                if (info is PhysicalFileInfo file)
                {
                    return(new PhysicalStorageFileInfo(file));
                }
                else if (info is PhysicalDirectoryInfo dir)
                {
                    return(new PhysicalStorageDirectoryInfo(dir));
                }
                // shouldn't happen unless BCL introduces new implementation of base type
                throw new InvalidOperationException("Unexpected type of FileSystemInfo");
            });

            Exists = (contents is PhysicalDirectoryContents physical) && physical.Exists;
        }