packages/Windows API Code Pack 1.1/source/WindowsAPICodePack/Shell/Common/ShellLibrary.cs
/// <summary>
/// Load the library using a number of options
/// </summary>
/// <param name="nativeShellItem">IShellItem</param>
/// <param name="isReadOnly">read-only flag</param>
/// <returns>A ShellLibrary Object</returns>
Load the library using a number of options
Load the library using a number of options
internal static ShellLibrary FromShellItem(IShellItem nativeShellItem, bool isReadOnly)
        {
            CoreHelpers.ThrowIfNotWin7();
            INativeShellLibrary nativeShellLibrary = (INativeShellLibrary)new ShellLibraryCoClass();
            AccessModes flags = isReadOnly ?
                    AccessModes.Read :
                    AccessModes.ReadWrite;
            nativeShellLibrary.LoadLibraryFromItem(nativeShellItem, flags);
            ShellLibrary library = new ShellLibrary(nativeShellLibrary);
            library.nativeShellItem = (IShellItem2)nativeShellItem;
            return library;
        }
internal static ShellLibrary FromShellItem ( IShellItem nativeShellItem , bool isReadOnly ) { CoreHelpers . ThrowIfNotWin7 ( ) ; INativeShellLibrary nativeShellLibrary = ( INativeShellLibrary ) new ShellLibraryCoClass ( ) ; AccessModes flags = isReadOnly ? AccessModes . Read : AccessModes . ReadWrite ; nativeShellLibrary . LoadLibraryFromItem ( nativeShellItem , flags ) ; ShellLibrary library = new ShellLibrary ( nativeShellLibrary ) ; library . nativeShellItem = ( IShellItem2 ) nativeShellItem ; return library ; }
Load the library using a number of options
Load the library using a number of options
A ShellLibrary Object
A ShellLibrary Object
nativeShellItem
IShellItem
None
isReadOnly
bool
None