Exemple #1
0
        private async void LoadLibraryIcon(LibraryLocationItem lib)
        {
            lib.IconData = await FileThumbnailHelper.LoadIconWithoutOverlayAsync(lib.Path, 24u);

            if (lib.IconData != null)
            {
                lib.Icon = await lib.IconData.ToBitmapAsync();
            }
        }
Exemple #2
0
 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);
 }
Exemple #3
0
        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;
        }
Exemple #4
0
 private static bool IsLibraryOnSidebar(LibraryLocationItem item) => item != null && !item.IsEmpty && item.IsDefaultLocation;