/// <summary> /// Shows the library management dialog which enables users to mange the library folders and default save location. /// </summary> /// <param name="knownFolder">A known folder based library</param> /// <param name="hwndOwner">The parent windows</param> /// <param name="title">A title for the library management dialog, or NULL to use the library name as the title</param> /// <param name="instruction">An optional help string to display for the library management dialog</param> /// <param name="allowAllLocations">If true, do not show warning dialogs about locations that cannot be indexed</param> /// <returns>true if the user cliked O.K, false if the user clicked Cancel</returns> public static bool ShowManageLibraryUI(KnownFolder knownFolder, IntPtr hwndOwner, string title, string instruction, bool allowAllLocations) { return ShowManageLibraryUI(knownFolder.Path, hwndOwner, title, instruction, allowAllLocations); }
/// <summary> /// Load an existing library and create a <see cref="ShellLibrary"/> object that enables /// the management of this library from a known folder location /// </summary> /// <param name="knownFolderLibrary">The known folder library to load</param> /// <param name="isWritable">Define the access code to the library</param> /// <returns>A <see cref="ShellLibrary"/> object</returns> public static ShellLibrary Load(KnownFolder knownFolderLibrary, bool isWritable) { IShellLibrary library = new ShellLibraryClass(); Guid folderId = knownFolderLibrary.FolderId; library.LoadLibraryFromKnownFolder(ref folderId, isWritable ? Windows7.DesktopIntegration.Interop.SafeNativeMethods.StorageInstantiationModes.STGM_READWRITE : Windows7.DesktopIntegration.Interop.SafeNativeMethods.StorageInstantiationModes.STGM_READ); string fullName = System.IO.Path.ChangeExtension(knownFolderLibrary.Path, ".library-ms"); ShellLibrary shellLibrary = new ShellLibrary(library, fullName); return shellLibrary; }