public IEnumerable <ShellObject> GetSelectedItems()
        {
            var shellItemArray = GetSelectedItemsArray();

            var count = ShellItemArray.GetShellItemCount(shellItemArray);

            for (var index = 0; index < count; ++index)
            {
                var shellItem   = ShellItemArray.GetShellItemAt(shellItemArray, index);
                var shellObject = ShellFactory.FromShellItem(new ShellItem((IShellItem2)shellItem));
                if (shellObject != null)
                {
                    yield return(shellObject);
                }
            }
        }
        /// <summary>
        ///     Gets a collection of files selected by the user.
        /// </summary>
        /// <returns>A collection of files.</returns>
        public IEnumerable <ShellFile> GetShellFiles()
        {
            var fileDialogNative = (IFileOpenDialog)this.FileDialogInternal.FileDialogNative;

            IShellItemArray shellItemArray;

            fileDialogNative.GetResults(out shellItemArray);

            var count = ShellItemArray.GetShellItemCount(shellItemArray);

            for (var index = 0; index < count; ++index)
            {
                var shellItem = ShellItemArray.GetShellItemAt(shellItemArray, index);
                var shellFile = ShellFactory.FromShellItem(new ShellItem((IShellItem2)shellItem)) as ShellFile;
                if (shellFile != null)
                {
                    yield return(shellFile);
                }
            }
        }