Ejemplo n.º 1
0
        /// <summary>
        /// Initializes <see cref="dir_enumerator"/>.
        /// </summary>
        protected void CreateEnumeratorInternal()
        {
            var dir = this.fs_info as DirectoryInfo;
            if (dir != null)
            {
                var enumerable = this.EnumerateFileSystemInfos();

                if (dir.Root != dir)
                {
                    // prepend ., ..
                    var dots = new FileSystemInfo[] { new DirectoryInfo(dir.FullName + "\\."), new DirectoryInfo(dir.FullName + "\\..") };
                    enumerable = dots.Concat(enumerable);
                }

                this.dir_enumerator = enumerable.GetEnumerator();
            }
            else
            {
                this.dir_enumerator = null;
            }
        }