コード例 #1
0
ファイル: ShellItem.cs プロジェクト: Athari/PresentationShell
        private int GetIconOverlayIndex()
        {
            if (_iconOverlayIndex != UndefinedIconIndex)
            {
                return(_iconOverlayIndex);
            }
            if (IsDesktop)
            {
                return(_iconOverlayIndex = NoIconIndex);
            }

            Dispatcher.InvokeAsync(
                () => {
                int iconOverlayIndex;
                using (NativeShellIconOverlay shellIconOverlay = ParentShellFolder.QueryInterface <IShellIconOverlay>().ToNative())
                    iconOverlayIndex = shellIconOverlay != null ? _tree.IconList.GetIconOverlayIndex(shellIconOverlay, _pidl) : NoIconIndex;
                Set(ref _iconOverlayIndex, iconOverlayIndex, "IconOverlaySmall", "IconOverlayLarge", "IconOverlayExtraLarge", "IconOverlayJumbo");
            },
                DispatcherPriority.Background);
            return(NoIconIndex);
        }
コード例 #2
0
ファイル: ShellItem.cs プロジェクト: Athari/PresentationShell
        private int GetIconIndex(GILI iconAttrs)
        {
            if (_iconIndex != UndefinedIconIndex)
            {
                return(_iconIndex);
            }
            if (IsDesktop)
            {
                using (PIDLIST desktopPidl = Native.SHGetKnownFolderIDList(FOLDERID.Desktop))
                    return(_iconIndex = Native.SHGetFileInfo(desktopPidl, SHGFI.SYSICONINDEX).iIcon);
            }

            Dispatcher.InvokeAsync(
                () => {
                int iconIndex;
                using (NativeShellIcon shellIcon = ParentShellFolder.QueryInterface <IShellIcon>().ToNative())
                    iconIndex = shellIcon != null ? _tree.IconList.GetIconIndex(shellIcon, _pidl, iconAttrs) : UnindexableIconIndex;
                Set(ref _iconIndex, iconIndex, "IconSmall", "IconLarge", "IconExtraLarge", "IconJumbo");
            },
                DispatcherPriority.Background);
            return(NoIconIndex);
        }
コード例 #3
0
ファイル: ShellItem.cs プロジェクト: Athari/PresentationShell
 private void UpdateAttrs(SFGAO newAttrs)
 {
     newAttrs  &= ~_attrsSet;
     _attrs    |= ParentShellFolder.GetAttributesOf(_pidl, newAttrs);
     _attrsSet |= newAttrs;
 }