private static void ShowInformation(ShellLibrary library) { Console.WriteLine("\nShowing information of {0} library", library.Name); Console.WriteLine("\tLibrary path: {0}", library.FullName); Console.WriteLine("\tIs pinned to navigation pane: {0}", library.IsPinnedToNavigationPane); string saveFolder = library.DefaultSaveFolder; Console.WriteLine("\tSave folder: {0}", saveFolder); Console.WriteLine("\tIcon: {0}", library.Icon); Guid folderTypeId = library.FolderTypeId; string folderTypeName = folderTypeId.ToString(); try { folderTypeName = FolderTypes.GetFolderType(folderTypeId); } catch { } Console.WriteLine("\tFolder type: {0}", folderTypeName); Console.WriteLine("\tFolder list:"); foreach (string folder in library.GetFolders()) { Console.WriteLine("\t\t{0} {1}", folder, saveFolder == folder ? "*" : ""); } }
/// <summary> /// Make the library manager state coherent with the underline shell library /// </summary> /// <param name="shellLibrary">The shell library path</param> private void UpdateLibraryState(ShellLibrary shellLibrary) { try { //break update loop _isIgnoreEvent = true; FolderList.Clear(); foreach (string folder in shellLibrary.GetFolders()) { FolderList.Add(folder); } DefaultSaveFolder = shellLibrary.DefaultSaveFolder; IsPinnedToNavigationPane = shellLibrary.IsPinnedToNavigationPane; string iconPath = shellLibrary.Icon; ShellIcon = string.IsNullOrEmpty(iconPath) ? null : Helper.GetIconBitmap(iconPath); string folderType; try { folderType = FolderTypes.GetFolderType(shellLibrary.FolderTypeId); } catch { folderType = ""; } FolderType = folderType; } finally { _isIgnoreEvent = false; } }