private IEnumerable <string> GetItemsInternal(string filter, DirectoryEnumerator.EnumerationType enumType, Predicate <NativeMethods.WIN32_FIND_DATA> extendedFilter = null)
        {
            string itemName;

            NativeMethods.WIN32_FIND_DATA findData;
            while (this.GetNextItem(filter, enumType, out itemName, out findData, extendedFilter))
            {
                yield return(itemName);
            }
            if (this.m_recurse)
            {
                foreach (string dir in this.m_realDirectories)
                {
                    string fullPath = Path.Combine(this.m_path.FullName, dir);
                    using (DirectoryEnumerator dirEnum = new DirectoryEnumerator(new DirectoryInfo(fullPath), this.m_recurse, this.m_includeRecycleBin))
                    {
                        foreach (string item in dirEnum.GetItemsInternal(filter, enumType, extendedFilter))
                        {
                            yield return(item);
                        }
                    }
                }
            }
            yield break;
        }
        public IEnumerable <string> EnumerateFiles(string filter, Predicate <NativeMethods.WIN32_FIND_DATA> extendedFilter = null)
        {
            if (!string.Equals(filter, "*"))
            {
                if (this.m_recurse)
                {
                    bool returnBaseNames = this.ReturnBaseNames;
                    try
                    {
                        this.ReturnBaseNames = false;
                        IEnumerable <string> directories = this.EnumerateDirectories("*", extendedFilter);
                        foreach (string dir in directories)
                        {
                            using (DirectoryEnumerator dirEnum = new DirectoryEnumerator(new DirectoryInfo(dir), false, this.m_includeRecycleBin))
                            {
                                dirEnum.ReturnBaseNames = returnBaseNames;
                                foreach (string item in dirEnum.GetItemsInternal(filter, DirectoryEnumerator.EnumerationType.Files, extendedFilter))
                                {
                                    yield return(item);
                                }
                            }
                        }
                    }
                    finally
                    {
                        this.ReturnBaseNames = returnBaseNames;
                    }
                    goto IL_1CD;
                }
            }
            string itemName;

            NativeMethods.WIN32_FIND_DATA findData;
            while (this.GetNextItem(filter, DirectoryEnumerator.EnumerationType.Files, out itemName, out findData, extendedFilter))
            {
                yield return(itemName);
            }
IL_1CD:
            yield break;
        }