예제 #1
0
        private static IEnumerable <string> GetFolders(Shell.IShellItemArray shellItems)
        {
            foreach (var shellItem in GetItems(shellItems))
            {
                yield return(GetDisplayName(shellItem, Shell.SIGDN.DESKTOPABSOLUTEPARSING));

                Marshal.ReleaseComObject(shellItem);
            }
        }
예제 #2
0
        private static IEnumerable <Shell.IShellItem> GetItems(Shell.IShellItemArray shellItems)
        {
            var count = default(uint);

            shellItems.GetCount(out count);
            for (var position = default(uint); position < count; position++)
            {
                var shellItem = default(Shell.IShellItem);
                shellItems.GetItemAt(position, out shellItem);
                yield return(shellItem);
            }
        }