private async void LoadLibraryIcon(LibraryLocationItem lib) { lib.IconData = await FileThumbnailHelper.LoadIconWithoutOverlayAsync(lib.Path, 24u); if (lib.IconData != null) { lib.Icon = await lib.IconData.ToBitmapAsync(); } }
public bool TryGetLibrary(string path, out LibraryLocationItem library) { if (string.IsNullOrWhiteSpace(path) || !path.ToLower().EndsWith(ShellLibraryItem.EXTENSION)) { library = null; return(false); } library = Libraries.FirstOrDefault(l => string.Equals(path, l.Path, StringComparison.OrdinalIgnoreCase)); return(library != null); }
public LibraryItem(LibraryLocationItem lib, string returnFormat = null) : base(null, returnFormat) { ItemPath = lib.Path; ItemName = lib.Text; PrimaryItemAttribute = StorageItemTypes.Folder; ItemType = "ItemTypeLibrary".GetLocalized(); LoadCustomIcon = true; CustomIcon = lib.Icon; IsEmpty = lib.IsEmpty; DefaultSaveFolder = lib.DefaultSaveFolder; Folders = lib.Folders; }
private static bool IsLibraryOnSidebar(LibraryLocationItem item) => item != null && !item.IsEmpty && item.IsDefaultLocation;